2009/4/12 Kent Johnson :
> try:
> tsoup = BeautifulSoup(data)
> except HTMLParseError, ex:
Aah, ex is the object/class which has the error data. This was the
missing piece for me.
Many thanks Kent!
Greets
Sander
___
Tutor maillist - Tutor@python.org
2009/4/10 Kent Johnson :
> Or, catch
> the exception, have the code find out where the error is and display
> the bad line.
This is what I was looking for. I know how to catch the exception but
how do I make it display the bad line?
Thanks
Sander
___
Tu
On Sun, Apr 12, 2009 at 10:21 AM, Sander Sweers wrote:
> 2009/4/10 Kent Johnson :
>> Or, catch
>> the exception, have the code find out where the error is and display
>> the bad line.
>
> This is what I was looking for. I know how to catch the exception but
> how do I make it display the bad line?
On Fri, Apr 10, 2009 at 5:08 PM, Sander Sweers wrote:
> Hello Tutors,
>
> I am having some issues with a malformed tag in a html page.
> BeautifulSoup barfs with the following.
>
> raceback (most recent call last):
> File "C:\Python25\lib\HTMLParser.py", line 115, in error
> raise HTMLParseEr