Re: BeautifulSoup error

2006-06-16 Thread William
"Serge Orlov" <[EMAIL PROTECTED]> writes: [...] > Look at the traceback: you're not calling BeautifulSoup module! In > fact, there is no feed method in the current BeautifulSoup > documentation. Maybe it used to work well, but now it's definitely > going to fail. As I understand documentation you

Re: BeautifulSoup error

2006-06-16 Thread Serge Orlov
William Xu wrote: > Hi, all, > > This piece of code used to work well. i guess the error occurs after > some upgrade. > > >>> import urllib > >>> from BeautifulSoup import BeautifulSoup > >>> url = 'http://www.google.com' > >>> port = urllib.urlopen(url).read() > >>> soup = BeautifulSoup() > >>> so

Re: BeautifulSoup error

2006-06-16 Thread Ben Finney
Slawomir Nowaczyk <[EMAIL PROTECTED]> writes: > >>> soup.feed( unicode(port,"iso-8859-1") ) Sure, once you have the encoding name. Visit a different URL, you may get a different encoding which should be used. -- \ "I believe in making the world safe for our children, but not | `\ou

Re: BeautifulSoup error

2006-06-16 Thread William Xu
Ben Finney <[EMAIL PROTECTED]> writes: > William Xu <[EMAIL PROTECTED]> writes: > >> >>> import urllib >> >>> from BeautifulSoup import BeautifulSoup >> >>> url = 'http://www.google.com' >> >>> port = urllib.urlopen(url).read() > > Gets the data from the HTTP response. (I'm not sure why you call t

Re: BeautifulSoup error

2006-06-16 Thread Slawomir Nowaczyk
On Fri, 16 Jun 2006 15:20:48 +1000 Ben Finney <[EMAIL PROTECTED]> wrote: #> > >>> soup = BeautifulSoup() #> > >>> soup.feed(port) #> > Traceback (most recent call last): #> > File "", line 1, in ? #> > File "/usr/lib/python2.3/sgmllib.py", line 94, in feed #> > self.rawdata = self.rawdata

Re: BeautifulSoup error

2006-06-15 Thread William Xu
"Serge Orlov" <[EMAIL PROTECTED]> writes: [...] > Upgrading python-beautifulsoup is a good idea, since there were two bug > fix releases after 3.0.1 I just downloaded latest version 3.0.3 from its homepage, seems it still has the same problem. -- William PL/I -- "the fatal disease" -- belongs

Re: BeautifulSoup error

2006-06-15 Thread Serge Orlov
William Xu wrote: > Hi, all, > > This piece of code used to work well. i guess the error occurs after > some upgrade. > > >>> import urllib > >>> from BeautifulSoup import BeautifulSoup > >>> url = 'http://www.google.com' > >>> port = urllib.urlopen(url).read() > >>> soup = BeautifulSoup() > >>> so

Re: BeautifulSoup error

2006-06-15 Thread Ben Finney
William Xu <[EMAIL PROTECTED]> writes: > >>> import urllib > >>> from BeautifulSoup import BeautifulSoup > >>> url = 'http://www.google.com' > >>> port = urllib.urlopen(url).read() Gets the data from the HTTP response. (I'm not sure why you call this "port".) The data is HTML text encoded to a st