Re: [Tutor] Make beautifulsoup show the data it has an issue with

2009-04-12 Thread Sander Sweers
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

Re: [Tutor] Make beautifulsoup show the data it has an issue with

2009-04-12 Thread Sander Sweers
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

Re: [Tutor] Make beautifulsoup show the data it has an issue with

2009-04-12 Thread Kent Johnson
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?

Re: [Tutor] Make beautifulsoup show the data it has an issue with

2009-04-10 Thread Kent Johnson
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