from bs4 import BeautifulSoup
html_doc = """
The Dormouse's story
Once upon a time there were three little sisters; and their names were Elsie, Lacie and Tillie; and they lived at the bottom of a well.
...
"""
BeautifulSoup(html_doc)
运行结果:
Traceback (most recent call last):
File "E:\workspace\ex\src\text1\text_urllib.py", line 16, in
BeautifulSoup(html_doc)
File "C:\Python36\lib\site-packages\bs4__init__.py", line 153, in init
builder = builder_class()
File "C:\Python36\lib\site-packages\bs4\builder_htmlparser.py", line 39, in init
return super(HTMLParserTreeBuilder, self).__init__(*args, **kwargs)
TypeError: init() got an unexpected keyword argument 'strict'
请问该怎样解决
html_doc内容精简一下。看看是不会内容格式有问题。逐步排除