Html to xml conversion

16 views
Skip to first unread message

brunovia...@gmail.com

unread,
Aug 13, 2007, 4:05:52 PM8/13/07
to
Hi,

sorry if this is a FAQ, I've done a quick search and haven't found an
answer.

I'm willing to convert a malformed HTML to XML using the same rules
that firefox uses. For example, in a document I have the HTML:

<tr>
<td></td>
<td>
<form>
<input ...>
</td>
</tr>
<tr>
<td></td>
<td>
</form>
</td>
</tr>

and firefox interpret it as:

<tr>
<td></td>
<td>
<form />
</td>
</tr>
<tr>
<td></td>
<td>
</td>
</tr>

Is it possible to reuse some firefox component to help me to do this
conversion? If so, is there any python binding to use it in a console
application?

Thank you for your attention.

regards,
Bruno

fantasai

unread,
Aug 15, 2007, 12:13:38 PM8/15/07
to
brunovia...@gmail.com wrote:
> Hi,
>
> sorry if this is a FAQ, I've done a quick search and haven't found an
> answer.
>
> I'm willing to convert a malformed HTML to XML using the same rules
> that firefox uses. ...

> Is it possible to reuse some firefox component to help me to do this
> conversion? If so, is there any python binding to use it in a console
> application?

Your best bet is probably to use html5lib:
http://code.google.com/p/html5lib/

~fantasai

brunovia...@gmail.com

unread,
Aug 18, 2007, 8:04:52 AM8/18/07
to
> Your best bet is probably to use html5lib:
> http://code.google.com/p/html5lib/
>
> ~fantasai

Thanks! I'll try it!

Reply all
Reply to author
Forward
0 new messages