On Tue, Nov 17, 2009 at 3:38 PM, Zeynel <azeyn...@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
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to