Scrapy URLError>>> ERROR: Caught exception reading instance data
来源:互联网 发布:java孤傲苍狼 博客园 编辑:程序博客网 时间:2024/05/20 13:20
scrapy运行爬虫URLError信息如下:
scrapy crawl book/home/xxxxxxx/work/python/tutorial/tutorial/spiders/book_spider.py:1: ScrapyDeprecationWarning: Module `scrapy.spider` is deprecated, use `scrapy.spiders` instead from scrapy.spider import Spider2017-06-09 11:34:15 [scrapy] INFO: Scrapy 1.0.1 started (bot: tutorial)2017-06-09 11:34:15 [scrapy] INFO: Optional features available: ssl, http11, boto2017-06-09 11:34:15 [scrapy] INFO: Overridden settings: {'NEWSPIDER_MODULE': 'tutorial.spiders', 'SPIDER_MODULES': ['tutorial.spiders'], 'BOT_NAME': 'tutorial'}2017-06-09 11:34:15 [scrapy] INFO: Enabled extensions: CloseSpider, TelnetConsole, LogStats, CoreStats, SpiderState2017-06-09 11:34:15 [boto] DEBUG: Retrieving credentials from metadata server.2017-06-09 11:34:16 [boto] ERROR: Caught exception reading instance dataTraceback (most recent call last): File "/usr/lib/python2.7/dist-packages/boto/utils.py", line 210, in retry_url r = opener.open(req, timeout=timeout) File "/usr/lib/python2.7/urllib2.py", line 429, in open response = self._open(req, data) File "/usr/lib/python2.7/urllib2.py", line 447, in _open '_open', req) File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(*args) File "/usr/lib/python2.7/urllib2.py", line 1228, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open raise URLError(err)URLError: <urlopen error timed out>2017-06-09 11:34:16 [boto] ERROR: Unable to read instance data, giving up2017-06-09 11:34:16 [scrapy] INFO: Enabled downloader middlewares: HttpAuthMiddleware, DownloadTimeoutMiddleware, UserAgentMiddleware, RetryMiddleware, DefaultHeadersMiddleware, MetaRefreshMiddleware, HttpCompressionMiddleware, RedirectMiddleware, CookiesMiddleware, HttpProxyMiddleware, ChunkedTransferMiddleware, DownloaderStats2017-06-09 11:34:16 [scrapy] INFO: Enabled spider middlewares: HttpErrorMiddleware, OffsiteMiddleware, RefererMiddleware, UrlLengthMiddleware, DepthMiddleware2017-06-09 11:34:16 [scrapy] INFO: Enabled item pipelines:2017-06-09 11:34:16 [scrapy] INFO: Spider opened2017-06-09 11:34:16 [scrapy] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)2017-06-09 11:34:16 [scrapy] DEBUG: Telnet console listening on 127.0.0.1:60232017-06-09 11:34:16 [scrapy] DEBUG: Crawled (200) <GET http://www.xxxxx.com/> (referer: None)2017-06-09 11:34:17 [scrapy] INFO: Closing spider (finished)2017-06-09 11:34:17 [scrapy] INFO: Dumping Scrapy stats:{'downloader/request_bytes': 210, 'downloader/request_count': 1, 'downloader/request_method_count/GET': 1, 'downloader/response_bytes': 6280, 'downloader/response_count': 1, 'downloader/response_status_count/200': 1, 'finish_reason': 'finished', 'finish_time': datetime.datetime(2017, 6, 9, 3, 34, 17, 18397), 'log_count/DEBUG': 3, 'log_count/ERROR': 2, 'log_count/INFO': 7, 'response_received_count': 1, 'scheduler/dequeued': 1, 'scheduler/dequeued/memory': 1, 'scheduler/enqueued': 1, 'scheduler/enqueued/memory': 1, 'start_time': datetime.datetime(2017, 6, 9, 3, 34, 16, 575498)}2017-06-09 11:34:17 [scrapy] INFO: Spider closed (finished)
原因如下:
That particular error message is being generated by boto
(boto 2.38.0 py27_0), which is used to connect to Amazon S3. Scrapy doesn't have this enabled by default.
解决办法:
网络上广泛给出的解决办法是在项目的settings.py文件中,加上
DOWNLOAD_HANDLERS = {'S3': None,}但是我按照这个方法添加完运行错误还在,最后在spider.py文件中加入
from scrapy import optional_featuresoptional_features.remove('boto')
问题得以解决。
阅读全文
1 0
- Scrapy URLError>>> ERROR: Caught exception reading instance data
- scrapy [boto] ERROR: Caught exception reading instance data URLError: <urlopen error [Errno 10051] >
- scrapy URLerror:<urlopen error [Error 10051]> 问题
- CoreData: error: Serious application error. Exception was caught during Core Data change processing
- While reading XXX pngcrush caught libpng error
- While reading XXX pngcrush caught libpng error:
- While reading XXX pngcrush caught libpng error: N
- While reading XXX pngcrush caught libpng error: N
- CParserError: Error tokenizing data. C error: Buffer overflow caught
- FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
- pngcrush caught libpng error: Not enough image data
- Unexpected Exception caught setting
- xcode运行到真机报错 While reading xx/BackgroundHomeScreen_5.png pngcrush caught libpng error:
- xcode运行到真机报错 While reading xx/BackgroundHomeScreen_5.png pngcrush caught libpng error:
- While reading /Users/xxx img.png pngcrush caught libpng error: Not a PNG file..
- 编译出现:While reading /Users/apple/Downloads/xxx/BgImage.png pngcrush caught libpng error?
- Unexpected Exception caught setting 'age'-Error setting expression 'age' with value ['3']
- Unexpected Exception caught setting 'upfile' on 'class yuhao.action.FileAction: Error setting expres
- 技术博客2
- Struts Spring Mybatis Hibernate J2EE Oracle架构图
- 揭露DOM操作以及性能优化
- 自定义view
- Android搜索功能的实现
- Scrapy URLError>>> ERROR: Caught exception reading instance data
- 特征工程
- 南阳oj 题目127 星际之门(一)
- windows下多python版本下的一个pip错误
- js中几种实用的跨域方法原理详解
- Sftp和ftp over ssh2的区别
- hive的简单增删改查
- jni和C 中文乱码
- 【原创】SSM框架下,添加activiti流程引擎配置--转载请注明出处