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

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 2017-02-26 12:07
    关注

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

    评论

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题