lxml to parse html

Adam Tauno Williams awilliam at whitemice.org
Mon Jan 23 10:30:40 EST 2012


On Mon, 2012-01-23 at 15:39 +0800, contro opinion wrote:
> import lxml.html
> myxml='''
> <cooperate>
> <job DecreaseHour="1" table="tpa_radio_sum">
> </job>

Use lxml.etree not lxml.html.  Your content is XML, not HTML.

-- 
System & Network Administrator [ LPI & NCLA ]
<http://www.whitemiceconsulting.com>
OpenGroupware Developer <http://www.opengroupware.us>
Adam Tauno Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/python-list/attachments/20120123/59b6a5a5/attachment-0001.sig>


More information about the Python-list mailing list