No parser was explicitly specified, so I'm using the best available HTML parser for this system ("ht...

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

 

转载于:https://www.cnblogs.com/huiAlex/p/7988294.html

你可能感兴趣的:(No parser was explicitly specified, so I'm using the best available HTML parser for this system ("ht...)