开发者

parse xhtml in python 2.6

开发者 https://www.devze.com 2022-12-21 02:42 出处:网络
xml.etree.ElementTree.parse is ch开发者_如何学编程oking on my xhtml file. I saw somewhere that lxml can handle html. Can someone tell me the documented way to parse, and then alter, xhtml? I want to a

xml.etree.ElementTree.parse is ch开发者_如何学编程oking on my xhtml file. I saw somewhere that lxml can handle html. Can someone tell me the documented way to parse, and then alter, xhtml? I want to add some javascript to xhtml on the fly.


Have you tried BeautifulSoup? It handles documents that aren't well formed and I've found it pretty good.

0

精彩评论

暂无评论...
验证码 换一张
取 消