【发布时间】:2018-11-09 10:03:58
【问题描述】:
我正在寻找一种将scrapy 与我保存在计算机上的html 页面一起使用的方法。就我而言,我遇到了一个错误:
requests.exceptions.InvalidSchema: No connection adapters were found for 'file:///home/stage/Guillaume/scraper_test/mypage/details.html'
SPIDER_START_URLS = ["file:///home/stage/Guillaume/scraper_test/mypage/details.html"]
【问题讨论】:
-
1.除非我弄错了,否则 Scrapy 长期以来一直支持
file:方案。 2.根据你分享的日志,看起来像是由著名的HTTP客户端库requests生成的东西,而不是Scrapy。 -
现在我真的不知道,因为我是新手,所以我不会浪费任何时间并使用静态服务器
-
抱歉没有说清楚。我认为您可能需要提供更多信息(更多行日志?一些相关代码?等),然后其他人才能尝试进一步挖掘并提供帮助。
-
所有日志:Deferred 中未处理的错误:2018-11-09 13:05:25 [twisted] CRITICAL: Traceback(最近一次调用最后):文件“/home/stage/miniconda3/envs/ scrapy_env/lib/python3.6/site-packages/twisted/internet/defer.py”,第 1386 行,在 _inlineCallbacks 结果 = g.send(result) 文件“/home/stage/miniconda3/envs/scrapy_env/lib/python3 .6/site-packages/scrapy/crawler.py",第 82 行,在爬网中产生 self.engine.open_spider(self.spider, start_requests) requests.exceptions.InvalidSchema:没有为 'file:/// 找到连接适配器主页/stage/Guillaume/scraper_test/mypage/details.html'
标签: html web-scraping scrapy local