Don't put html, head and body tags automatically, beautifulsoup

前端 未结 8 1520
青春惊慌失措
青春惊慌失措 2020-12-03 09:40

using beautifulsoup with html5lib, it puts the html, head and body tags automatically:

BeautifulSoup(\'

FOO

\', \'html5lib\') # => <
8条回答
  •  孤城傲影
    2020-12-03 10:13

    If you want it to look better, try this:

    BeautifulSoup([contents you want to analyze].prettify())

提交回复
热议问题