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

前端 未结 8 1519
青春惊慌失措
青春惊慌失措 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:31

    Here is how I do it

    a = BeautifulSoup()
    a.append(a.new_tag('section'))
    #this will give you 

提交回复
热议问题