Web 请说明如何解决此问题。。?我想做一个网络垃圾

Web 请说明如何解决此问题。。?我想做一个网络垃圾,web,web-scraping,spyder,Web,Web Scraping,Spyder,没有这样的文件或目录:“hackathon.html” 在spyder上运行代码时出现错误 from bs4 import BeautifulSoup with open('hackathon.html','r') as html_file: content=html_file.read() print(content) \\hackathon.html保存在我的桌面上将文件放在运行脚本的目录中,或提供open()完整路径信息

没有这样的文件或目录:“hackathon.html” 在spyder上运行代码时出现错误

from bs4 import BeautifulSoup
with open('hackathon.html','r') as html_file:
    content=html_file.read()
print(content)

\\hackathon.html
保存在我的桌面上

将文件放在运行脚本的目录中,或提供
open()
完整路径信息