No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser").警告解决方法

在使用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")

 

posted @ 2017-12-05 17:19  一只敲码的猫  阅读(1037)  评论(0编辑  收藏  举报