如何使用 lxml 处理嵌套表单标签
我想抓取一些带有 lxml 嵌套表单元素的 html 页面。即使 BeautifulSoup 在这些页面上也会卡住,到目前为止我发现唯一可以处理它们的解析器是 MinimalSoup,它不知道哪些标签可以嵌套或不可以嵌套。
lxml 是否有任何不关心嵌套表单标签的解析器? 还有其他建议吗?
如果有必要,我会继续使用 MinimalSoup。
I want to scrape some html pages that have nested form elements with lxml. Even BeautifulSoup chokes on these pages, the only parser I've found that can handle them so far is MinimalSoup which has no knowledge of which tags can be nested or not.
Does lxml have any parsers that don't care about about nested form tags?
Any other suggestions?
If I have to I'll just continue using MinimalSoup.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
lxml.etree.HTMLParser 怎么样?这应该工作得比较好,对吧?
你有你的树了!
How about lxml.etree.HTMLParser? That should work relatively well, right?
And you have your tree!