您当前的位置: 首页 >  ar
  • 0浏览

    0关注

    2393博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

成功解决bs4\__init__.py:181: UserWarning: No parser was explicitly specified, so I'm using the best avai

一个处女座的程序猿 发布时间:2019-03-08 12:18:29 ,浏览量:0

 

解决问题

bs4\__init__.py:181: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). 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.

To get rid of this warning, change code that looks like this:
  BeautifulSoup(YOUR_MARKUP})
to this:
  BeautifulSoup(YOUR_MARKUP, "lxml")
  markup_type=markup_type))

 

解决思路

bs4 \ __init__    用户警告:没有显式指定解析器,所以我使用这个系统中可用的最佳HTML解析器(“lxml”)。 这通常不是问题,但是如果您在另一个系统上或在不同的虚拟环境中运行这段代码,它可能会使用不同的解析器,并且行为也会有所不同。

  解决方法

此信息提示为警告,即使不处理也不会影响代码编程。如果想要去掉,可以更新库至最新版本,按照下边方法修改即可!

To get rid of this warning, change code that looks like this:
  BeautifulSoup(YOUR_MARKUP})
to this:
  BeautifulSoup(YOUR_MARKUP, "lxml")
  markup_type=markup_type))

 

 

关注
打赏
1664196048
查看更多评论
立即登录/注册

微信扫码登录

0.0543s