BeautifulSoup报错

: GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

The code that caused this warning is on line 32 of the file D:\PycharmProjects\pythonProject1\11.py. To get rid of this warning, pass the additional argument 'features="html.parser"' to the BeautifulSoup constructor.

soup = BeautifulSoup(html)

 

简单理解就是把soup = BeautifulSoup(html)改成soup = BeautifulSoup("html.parser")很容易理解

未经允许不得转载:OZ分享-吉家大宝官方博客 » BeautifulSoup报错

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

置顶文章