【问题标题】:please how do i fix this issue..? i am trying to make a webscraper请问我该如何解决这个问题..?我正在尝试制作一个网络刮板
【发布时间】:2021-01-27 16:08:22
【问题描述】:

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

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

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

【问题讨论】:

    标签: web web-scraping spyder


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-23
      • 1970-01-01
      • 2017-05-30
      • 2022-11-03
      • 2023-03-25
      • 2020-03-25
      • 2020-02-14
      相关资源
      最近更新 更多