Beautifulsoup code that is not running

Brian J Mingus Brian.Mingus at Colorado.EDU
Tue Nov 17 18:33:01 EST 2009


On Tue, Nov 17, 2009 at 3:38 PM, Zeynel <azeynel1 at gmail.com> wrote:

> 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)


The problem has nothing to do with BeautifulSoup

>>> from BeautifulSoup import BeautifulSoup
>>> print BeautifulSoup('<title>mytitle</title>').title.string
mytitle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091117/dd157560/attachment-0001.html>


More information about the Python-list mailing list