Hobart-CF 2019-11-01 23:11 采纳率: 0%
浏览 1153

为什么我的html5lib用不了?

python我已经下载过html5lib但是在bs4中使用却显示没有这个html5lib

from bs4 import BeautifulSoup


html = "<p><a href='www.baidu.com'>你好</a></p>"
soup = BeautifulSoup(html,"html5lib")
print(soup)
#以下是报错信息
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib. Do you need to install a parser library?

ps:在使用lxml、html.parser等解析器时均可使用,只有html5lib不能使用
pps:由于我需要爬取网页信息标签写的不规范,标签有缺失一点要使用
html5lib才可以解析,不能使用其他解析器

  • 写回答

1条回答 默认 最新

  • 关注
    评论

报告相同问题?

悬赏问题

  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?
  • ¥50 invest生境质量模块