baidu_37647687
baidu_37647687
2017-02-26 08:00
采纳率: 0%
浏览 13.5k

TypeError: __init__() got an unexpected keyword argument 'strict'

from bs4 import BeautifulSoup

html_doc = """

The Dormouse's story

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'
请问该怎样解决

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • oyljerry
    oyljerry 2017-02-26 12:07

    html_doc内容精简一下。看看是不会内容格式有问题。逐步排除

    点赞 评论

相关推荐