欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

成功解决 bs4\__init__.py:219: UserWarning: b'.' looks like a filename, not markup. You should probably

发布时间:2025/3/21 38 豆豆
生活随笔 收集整理的这篇文章主要介绍了 成功解决 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,即使不处理也不会影响代码编程的运行。如果想要去掉,可以更新库至最新版本!
然后根据要求提示修改使用方法!

 

 

 

 

 

 

 

《新程序员》:云原生和全面数字化实践50位技术专家共同创作,文字、视频、音频交互阅读

总结

以上是生活随笔为你收集整理的成功解决 bs4\__init__.py:219: UserWarning: b'.' looks like a filename, not markup. You should probably的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。