HTMLParseError: malformed start tag

Showing 1-3 of 3 messages
HTMLParseError: malformed start tag Aether 3/30/09 10:19 PM
I'm new to beautiful soup and am  trying to grab some values off a
table but am having some trouble.
I think the problem is stemming from img tags that are written like
 <img src"=" width=1 height=1 border=0>

So I think it is being brought up from needing to switch the " and the

here is a clip of the code:

1                RemoveTags = ['img', 'input', 'form', 'script']
2                proxy_con = urllib2.ProxyHandler({"http":"http://"})
3                proxy_open = urllib2.build_opener(proxy_con)
4                LookupName = Name.replace(" ", "+")
5                url = '' +
6                print str(url)
7                page =
8                soup = BeautifulSoup(page, parseOnlyThese=table)
9                print str(soup)
10                 for tag in soup.findAll():
11                       if in RemoveTags:
12                               tag.extract()
13              CharacterInfo = soup.find('td', width="20%")
14              print str(CharacterInfo)

the prints are just in there to help me debug
The error seems to be happening on line 8, and I'm not sure how to
parse out this mistake before this line.

I would really like to just get rid of the img tag alltogether however
its nested in the table and dont know how.
If anyone could please help me with any methods or anything about how
I could do this I would really appreciate it.
And if anyone has any advice of where I could improve, or other guides
besides the documentation I could read please don't hesitate to let me

Thank you.
Re: HTMLParseError: malformed start tag Leonard Richardson 3/31/09 5:29 AM

This is a well-known problem. See here:

Re: HTMLParseError: malformed start tag Aether 3/31/09 6:11 PM
Thank you, after posting this I also discovered others were having
this problem.
however in case anyone else sees this I found a solution that worked
for my specific case,
in case it helps anyone else:

                page =
                page =
                page = page.replace("\"=", "=\"")
                soup = BeautifulSoup(page, parseOnlyThese=table)

since for the page i was looking at there was never a reason for the
quotation mark to come before the equal sign

On Mar 31, 5:29 am, Leonard Richardson <> wrote:
> Hi,
> This is a well-known problem. See here:
> Leonard