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

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

解决问题


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))

 


相关文章
|
4天前
|
Python
__init__.py
【6月更文挑战第30天】
9 3
|
2月前
|
机器学习/深度学习 并行计算 安全
ImportError: DLL load failed while importing libpaddle: 找不到指定的模块。问题处理
【5月更文挑战第12天】ImportError: DLL load failed while importing libpaddle: 找不到指定的模块。问题处理
364 0
AttributeError: module ‘torch.utils‘ has no attribute ‘data‘
属性错误:模块的'torch.utils'没有属性'data'
76 0
成功解决 bs4\__init__.py:219: UserWarning: "b'.'" looks like a filename, not markup. You should probably
成功解决 bs4\__init__.py:219: UserWarning: "b'.'" looks like a filename, not markup. You should probably
|
算法框架/工具 Caffe
File "/usr/local/lib/python3.5/site-packages/dateutil/rrule.py", line 55 raise ValueError
File "/usr/local/lib/python3.5/site-packages/dateutil/rrule.py", line 55 raise ValueError
92 0
|
Python
from scipy import special, optimize, from ._nnls import nnls ImportError: DLL load failed: 找不到指定的模块。
from scipy import special, optimize, from ._nnls import nnls ImportError: DLL load failed: 找不到指定的模块。
561 0
from scipy import special, optimize, from ._nnls import nnls ImportError: DLL load failed: 找不到指定的模块。
成功解决 File "h5py\h5t.pxd", line 14, in init h5py._conv (D:\Build\h5py\h5py-2.7.0\h5py\_conv.c:7539)
成功解决 File "h5py\h5t.pxd", line 14, in init h5py._conv (D:\Build\h5py\h5py-2.7.0\h5py\_conv.c:7539)
成功解决 File "h5py\h5t.pxd", line 14, in init h5py._conv (D:\Build\h5py\h5py-2.7.0\h5py\_conv.c:7539)
成功解决h5py\_init_.py:26:FutureWarning: Conversion of the second argument of issubdtype from `float` to
成功解决h5py\_init_.py:26:FutureWarning: Conversion of the second argument of issubdtype from `float` to
成功解决h5py\_init_.py:26:FutureWarning: Conversion of the second argument of issubdtype from `float` to
成功解决\h5py\__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float
成功解决\h5py\__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float