相关疑难解决方法(0)

不要自动放置html,head和body标签,beautifulsoup

使用带有html5lib的beautifulsoup,它会自动放置html,head和body标签:

BeautifulSoup('<h1>FOO</h1>', 'html5lib') # => <html><head></head><body><h1>FOO</h1></body></html>
Run Code Online (Sandbox Code Playgroud)

我可以设置任何选项,关闭此行为?

python beautifulsoup html5lib

29
推荐指数
3
解决办法
8379
查看次数

标签 统计

beautifulsoup ×1

html5lib ×1

python ×1