Html Parsing With Lxml When There's No Root Tag
I've been building a scaffolding library for sqlalchemy using lxml and formalchemy, and I'm having a hard time getting them to play nicely. specifically, formalchemy.FieldSet.rend
Solution 1:
For parsing HTML you want to use lxml.html
, not lxml.etree
.
If you want a list of fragments instead of wrapping them in a div
you can use fragments_fromstring(string)
as described here.
Post a Comment for "Html Parsing With Lxml When There's No Root Tag"