Beautifulsoup code that is not running

Zeynel azeynel1 at gmail.com
Tue Nov 17 17:38:55 EST 2009


Hello,

Please help with this code suggested in the beautifulsoup group
http://groups.google.com/group/beautifulsoup/browse_frm/thread/d288555c6992ceaa

>>> from BeautifulSoup import BeautifulSoup

>>> soup = BeautifulSoup (file("test.html").read())
>>> title = soup.find('title')
>>> titleString = title.string
>>> open('extract.text', 'w').write(titleString)

This runs without an error, but nothing is written into the
extract.text file. test.html has <title></title> tags in it.

Thank you.



More information about the Python-list mailing list