爬虫cnblogs提示错误

来源:4-4 pycharm中调试scrapy源码

qq_慕神6513837

2021-12-31

爬虫cnblogs提示以下错误,另外settings.py文件中已设置ROBOTSTXT_OBEY = False

E:\scrapy\envs\python38\Scripts\python.exe “C:\Program Files\JetBrains\PyCharm Community Edition 2021.2.3\plugins\python-ce\helpers\pydev\pydevd.py” --multiproc --qt-support=auto --client 127.0.0.1 --port 60783 --file E:/scrapy/code/ArticleSpider/main.py
Connected to pydev debugger (build 212.5457.59)
2021-12-31 10:27:19 [scrapy.utils.log] INFO: Scrapy 2.5.1 started (bot: ArticleSpider)
2021-12-31 10:27:19 [scrapy.utils.log] INFO: Versions: lxml 4.7.1.0, libxml2 2.9.10, cssselect 1.1.0, parsel 1.6.0, w3lib 1.22.0, Twisted 20.3.0, Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)], pyOpenSSL 21.0.0 (OpenSSL 1.1.1m 14 Dec 2021), cryptography 36.0.1, Platform Windows-10-10.0.19041-SP0
2021-12-31 10:27:19 [scrapy.utils.log] DEBUG: Using reactor: twisted.internet.selectreactor.SelectReactor
2021-12-31 10:27:19 [scrapy.crawler] INFO: Overridden settings:
{‘BOT_NAME’: ‘ArticleSpider’,
‘NEWSPIDER_MODULE’: ‘ArticleSpider.spiders’,
‘SPIDER_MODULES’: [‘ArticleSpider.spiders’]}
2021-12-31 10:27:19 [scrapy.extensions.telnet] INFO: Telnet Password: 849490023f3e63a5
2021-12-31 10:27:19 [scrapy.middleware] INFO: Enabled extensions:
[‘scrapy.extensions.corestats.CoreStats’,
‘scrapy.extensions.telnet.TelnetConsole’,
‘scrapy.extensions.logstats.LogStats’]
2021-12-31 10:27:20 [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’]
2021-12-31 10:27:20 [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’]
2021-12-31 10:27:20 [scrapy.middleware] INFO: Enabled item pipelines:
[]
2021-12-31 10:27:20 [scrapy.core.engine] INFO: Spider opened
2021-12-31 10:27:20 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2021-12-31 10:27:20 [scrapy.extensions.telnet] INFO: Telnet console listening on 127.0.0.1:6023
2021-12-31 10:27:20 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting (302) to <GET https://news.cnblogs.com/> from <GET http://news.cnblogs.com/>
2021-12-31 10:27:21 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://news.cnblogs.com/> (referer: None)
2021-12-31 10:27:21 [scrapy.core.engine] INFO: Closing spider (finished)
2021-12-31 10:27:21 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{‘downloader/request_bytes’: 432,
‘downloader/request_count’: 2,
‘downloader/request_method_count/GET’: 2,
‘downloader/response_bytes’: 16977,
‘downloader/response_count’: 2,
‘downloader/response_status_count/200’: 1,
‘downloader/response_status_count/302’: 1,
‘elapsed_time_seconds’: 0.938979,
‘finish_reason’: ‘finished’,
‘finish_time’: datetime.datetime(2021, 12, 31, 2, 27, 21, 190215),
‘httpcompression/response_bytes’: 81238,
‘httpcompression/response_count’: 1,
‘log_count/DEBUG’: 2,
‘log_count/INFO’: 10,
‘response_received_count’: 1,
‘scheduler/dequeued’: 2,
‘scheduler/dequeued/memory’: 2,
‘scheduler/enqueued’: 2,
‘scheduler/enqueued/memory’: 2,
‘start_time’: datetime.datetime(2021, 12, 31, 2, 27, 20, 251236)}
2021-12-31 10:27:21 [scrapy.core.engine] INFO: Spider closed (finished)

Process finished with exit code 0

写回答

2回答

gzidzcs

2022-08-31

请问这个问题解决了吗,我也有同样的问题

0
0

bobby

2022-01-02

你的cnblogs的爬虫代码贴一下我看看 这里看起来没有报错,你是否登录了?

0
5
bobby
回复
gzidzcs
你留下qq 我加你看看吧
2022-09-05
共5条回复

Scrapy打造搜索引擎 畅销4年的Python分布式爬虫课

带你彻底掌握Scrapy,用Django+Elasticsearch搭建搜索引擎

5795 学习 · 6290 问题

查看课程