在使用BeautifulSoup库时出现该警告,虽然不影响正常运行,但强迫症不能忍啊!!

详细警告信息如下:

UserWarning: 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.

用户警告:没有指定解析器,所以自动采用了HTML解析器。这不是一个问题,但是如果你在其他系统或虚拟环境下运行该代码,可能采用其他的解析器,导致不同的运行结果

解决办法:指定HTML解析器

BeautifulSoup(res.text, "html.parser")

 

相关文章:

  • 2022-12-23
  • 2022-03-02
  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-20
  • 2022-12-23
  • 2021-08-08
  • 2021-07-26
  • 2022-01-19
  • 2022-12-23
  • 2021-04-29
相关资源
相似解决方案