新手入门scrapy报错 求帮忙看看

新手入门scrapy报错 求帮忙看看

D:\pythonProject2\Scrapy\bilibili_spider>scrapy crawl bilibili -o test.csv
2020-11-25 10:26:00 [scrapy.utils.log] INFO: Scrapy 2.4.1 started (bot: bilibili_spider)
2020-11-25 10:26:00 [scrapy.utils.log] INFO: Versions: lxml 4.6.1.0, libxml2 2.9.5, cssselect 1.1.0, parsel 1.6.0, w3lib 1.22.0, Twisted 20.3.0, Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20
2020, 15:43:08) [MSC v.1926 32 bit (Intel)], pyOpenSSL 19.1.0 (OpenSSL 1.1.1h 22 Sep 2020), cryptography 3.2.1, Platform Windows-10-10.0.18362-SP0
2020-11-25 10:26:00 [scrapy.utils.log] DEBUG: Using reactor: twisted.internet.selectreactor.SelectReactor
2020-11-25 10:26:00 [scrapy.crawler] INFO: Overridden settings:
{'BOT_NAME': 'bilibili_spider',
'NEWSPIDER_MODULE': 'bilibili_spider.spiders',
'SPIDER_MODULES': ['bilibili_spider.spiders']}
2020-11-25 10:26:00 [scrapy.extensions.telnet] INFO: Telnet Password: 0fffaa707674e6f0
2020-11-25 10:26:00 [scrapy.middleware] INFO: Enabled extensions:
['scrapy.extensions.corestats.CoreStats',
'scrapy.extensions.telnet.TelnetConsole',
'scrapy.extensions.feedexport.FeedExporter',
'scrapy.extensions.logstats.LogStats']
2020-11-25 10:26:00 [scrapy.middleware] INFO: Enabled downloader middlewares:
['scrapy.downloadermiddlewares.httpauth.HttpAuthMiddleware',
'scrapy.downloadermiddlewares.downloadtimeout.DownloadTimeoutMiddleware',
'scrapy.downloadermiddlewares.defaultheaders.DefaultHeadersMiddleware',
'scrapy.downloadermiddlewares.useragent.UserAgentMiddleware',
'scrapy.downloadermiddlewares.retry.RetryMiddleware',
'scrapy.downloadermiddlewares.redirect.MetaRefreshMiddleware',
'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware',
'scrapy.downloadermiddlewares.redirect.RedirectMiddleware',
'scrapy.downloadermiddlewares.cookies.CookiesMiddleware',
'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware',
'scrapy.downloadermiddlewares.stats.DownloaderStats']
2020-11-25 10:26:00 [scrapy.middleware] INFO: Enabled spider middlewares:
['scrapy.spidermiddlewares.httperror.HttpErrorMiddleware',
'scrapy.spidermiddlewares.offsite.OffsiteMiddleware',
'scrapy.spidermiddlewares.referer.RefererMiddleware',
'scrapy.spidermiddlewares.urllength.UrlLengthMiddleware',
'scrapy.spidermiddlewares.depth.DepthMiddleware']
2020-11-25 10:26:00 [scrapy.middleware] INFO: Enabled item pipelines:
['bilibili_spider.pipelines.BilibiliSpiderPipeline']
2020-11-25 10:26:00 [scrapy.core.engine] INFO: Spider opened
2020-11-25 10:26:00 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2020-11-25 10:26:00 [scrapy.extensions.telnet] INFO: Telnet console listening on 127.0.0.1:6023
2020-11-25 10:26:07 [scrapy.downloadermiddlewares.retry] DEBUG: Retrying <GET http://https//www.bilibili.com/bangumi/media/md28229420/?spm_id_from=666.25.b_6d656469615f6d6f64756c65.6/> (f
ailed 1 times): DNS lookup failed: no results for hostname lookup: https.
2020-11-25 10:26:09 [scrapy.downloadermiddlewares.retry] DEBUG: Retrying <GET http://https//www.bilibili.com/bangumi/media/md28229420/?spm_id_from=666.25.b_6d656469615f6d6f64756c65.6/> (f
ailed 2 times): DNS lookup failed: no results for hostname lookup: https.
2020-11-25 10:26:11 [scrapy.downloadermiddlewares.retry] ERROR: Gave up retrying <GET http://https//www.bilibili.co...
5.6/> (failed 3 times): DNS lookup failed: no results for hostname lookup: https.
2020-11-25 10:26:12 [scrapy.core.scraper] ERROR: Error downloading <GET http://https//www.bilibili.com/bangumi/media/md28229420/?spm_id_from=666.25.b_6d656469615f6d6f64756c65.6/>
Traceback (most recent call last):
File "d:\pythonproject2\venv\lib\site-packages\twisted\internet\defer.py", line 1416, in _inlineCallbacks

result = result.throwExceptionIntoGenerator(g)

File "d:\pythonproject2\venv\lib\site-packages\twisted\python\failure.py", line 512, in throwExceptionIntoGenerator

return g.throw(self.type, self.value, self.tb)

File "d:\pythonproject2\venv\lib\site-packages\scrapy\core\downloader\middleware.py", line 45, in process_request

return (yield download_func(request=request, spider=spider))

File "d:\pythonproject2\venv\lib\site-packages\twisted\internet\defer.py", line 654, in _runCallbacks

current.result = callback(current.result, *args, **kw)

File "d:\pythonproject2\venv\lib\site-packages\twisted\internet\endpoints.py", line 981, in startConnectionAttempts

raise error.DNSLookupError(

twisted.internet.error.DNSLookupError: DNS lookup failed: no results for hostname lookup: https.
2020-11-25 10:26:12 [scrapy.core.engine] INFO: Closing spider (finished)
2020-11-25 10:26:12 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{'downloader/exception_count': 3,
'downloader/exception_type_count/twisted.internet.error.DNSLookupError': 3,
'downloader/request_bytes': 891,
'downloader/request_count': 3,
'downloader/request_method_count/GET': 3,
'elapsed_time_seconds': 11.525664,
'finish_reason': 'finished',
'finish_time': datetime.datetime(2020, 11, 25, 2, 26, 12, 216024),
'log_count/DEBUG': 2,
'log_count/ERROR': 2,
'log_count/INFO': 10,
'retry/count': 2,
'retry/max_reached': 1,
'retry/reason_count/twisted.internet.error.DNSLookupError': 2,
'scheduler/dequeued': 3,
'scheduler/dequeued/memory': 3,
'scheduler/enqueued': 3,
'scheduler/enqueued/memory': 3,
'start_time': datetime.datetime(2020, 11, 25, 2, 26, 0, 690360)}
2020-11-25 10:26:12 [scrapy.core.engine] INFO: Spider closed (finished)


回答:

域名写错了。

以上是 新手入门scrapy报错 求帮忙看看 的全部内容, 来源链接: utcz.com/p/937891.html

回到顶部