成功解决 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

解决问题


F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:219: UserWarning: "b'.'" looks like a filename, not markup. You should probably open this file and pass the filehandle into Beautiful Soup.

 ' Beautiful Soup.' % markup)

F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:282: UserWarning: "http://www.archive.org/details/LovefromaStranger"" looks like a URL. Beautiful Soup is not an HTTP client. You should probably use an HTTP client like requests to get the document behind the URL, and feed that document to Beautiful Soup.

 ' that document to Beautiful Soup.' % decoded_markup

F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:282: UserWarning: "http://www.loosechangeguide.com/LooseChangeGuide.html"" looks like a URL. Beautiful Soup is not an HTTP client. You should probably use an HTTP client like requests to get the document behind the URL, and feed that document to Beautiful Soup.

 ' that document to Beautiful Soup.' % decoded_markup

F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:219: UserWarning: "b'... ...'" looks like a filename, not markup. You should probably open this file and pass the filehandle into Beautiful Soup.

 ' Beautiful Soup.' % markup)

F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:219: UserWarning: "b'...'" looks like a filename, not markup. You should probably open this file and pass the filehandle into Beautiful Soup.

 ' Beautiful Soup.' % markup)

F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:219: UserWarning: "b'....'" looks like a filename, not markup. You should probably open this file and pass the filehandle into Beautiful Soup.

 ' Beautiful Soup.' % markup)

F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:282: UserWarning: "http://www.msnbc.msn.com/id/4972055/site/newsweek/"" looks like a URL. Beautiful Soup is not an HTTP client. You should probably use an HTTP client like requests to get the document behind the URL, and feed that document to Beautiful Soup.

 ' that document to Beautiful Soup.' % decoded_markup

F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:219: UserWarning: "b'..'" looks like a filename, not markup. You should probably open this file and pass the filehandle into Beautiful Soup.

 ' Beautiful Soup.' % markup)

F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:282: UserWarning: "http://www.youtube.com/watch?v=a0KSqelmgN8"" looks like a URL. Beautiful Soup is not an HTTP client. You should probably use an HTTP client like requests to get the document behind the URL, and feed that document to Beautiful Soup.

 ' that document to Beautiful Soup.' % decoded_markup

F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:219: UserWarning: "b'.. .'" looks like a filename, not markup. You should probably open this file and pass the filehandle into Beautiful Soup.

 ' Beautiful Soup.' % markup)

F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:282: UserWarning: "http://jake-weird.blogspot.com/2007/08/beneath.html"" looks like a URL. Beautiful Soup is not an HTTP client. You should probably use an HTTP client like requests to get the document behind the URL, and feed that document to Beautiful Soup.

 ' that document to Beautiful Soup.' % decoded_markup





解决思路


发生地址:bs4\__init__.py:219:

F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:219:

用户警告:“b”。看起来像文件名,而不是标记。您可能应该打开这个文件并将文件句柄传递到Beautiful Soup中。

F:\Program Files\Python\Python36\lib\site-packages\bs4\__init__.py:282:

用户警告:“http://www.archive.org/details/LovefromaStranger”“看起来像一个URL”。Beautiful Soup不是HTTP客户机。您可能应该使用HTTP客户机之类的请求来获取URL后面的文档,并将该文档提供给Beautiful Soup。

 ' that document to Beautiful Soup.' % decoded_markup

F: \ Python程序文件\ \ Python36 \ lib \网站\ bs4 \ __init__。用户警告:“http://www.loosechangeguide.com/LooseChangeGuide.html”“看起来像一个URL”。Beautiful Soup不是HTTP客户机。您可能应该使用HTTP客户机之类的请求来获取URL后面的文档,并将该文档提供给Beautiful Soup。

 ' that document to Beautiful Soup.' % decoded_markup






解决方法


此信息提示为警告,而不是error,即使不处理也不会影响代码编程的运行。如果想要去掉,可以更新库至最新版本!

然后根据要求提示修改使用方法!





相关文章
|
4月前
|
机器学习/深度学习 缓存 Python
Cannot find reference ‘TruncatedNormal‘ in ‘__init__.py‘
本文提供了解决在PyCharm中运行论文复现代码时出现的"Cannot find reference 'TruncatedNormal' in '__init__.py'"错误的两种方法:清除缓存和重启,以及在`__init__.py`文件中加入`TruncatedNormal`类。
|
3月前
|
数据库 Python
Traceback(most recent call last):File "main.py", line 4l,in<module>alueError: sleep length must be n
Traceback(most recent call last):File "main.py", line 4l,in<module>alueError: sleep length must be n
|
5月前
|
Python
Cannot find reference ‘args‘ in ‘__init__.pyi‘ ,request要写对
Cannot find reference ‘args‘ in ‘__init__.pyi‘ ,request要写对
|
7月前
|
IDE 开发工具 Android开发
Couldn‘t get post build model. Module:UpdateService_0804.main Variant: debugOpen logcat panel fo
Couldn‘t get post build model. Module:UpdateService_0804.main Variant: debugOpen logcat panel fo
89 0
|
安全 Python
YAML+PyYAML笔记 8 | PyYAML源码之full_load(),full_load_all(),safe_load(),unsafe_load(),unsafe_load_all()
YAML+PyYAML笔记 8 | PyYAML源码之full_load(),full_load_all(),safe_load(),unsafe_load(),unsafe_load_all()
142 1
|
TensorFlow 算法框架/工具 Python
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
AttributeError: module ‘torch.utils‘ has no attribute ‘data‘
属性错误:模块的'torch.utils'没有属性'data'
108 0
|
算法框架/工具 Windows
成功解决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

热门文章

最新文章