去掉input("回车继续:")或将input换成time.sleep(3)报错
来源:4-15 items的定义和使用 - 2
慕网Yellow_Peach
2021-10-05
2021-10-05 15:48:21 [scrapy.utils.log] INFO: Scrapy 2.5.0 started (bot: ArticleSpider)
2021-10-05 15:48:21 [scrapy.utils.log] INFO: Versions: lxml 4.6.3.0, libxml2 2.9.5, cssselect 1.1.0, parsel 1.6.0, w3lib 1.22.0, Twisted 21.7.0, Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)], pyOpenSSL 20.0.1 (OpenSSL 1.1.1l 24 Aug 2021), cryptography 3.4.8, Platform Windows-10-10.0.19041-SP0
2021-10-05 15:48:21 [scrapy.utils.log] DEBUG: Using reactor: twisted.internet.selectreactor.SelectReactor
2021-10-05 15:48:21 [scrapy.crawler] INFO: Overridden settings:
{‘BOT_NAME’: ‘ArticleSpider’,
‘NEWSPIDER_MODULE’: ‘ArticleSpider.spiders’,
‘SPIDER_MODULES’: [‘ArticleSpider.spiders’]}
2021-10-05 15:48:21 [scrapy.extensions.telnet] INFO: Telnet Password: a09934bb0facee12
2021-10-05 15:48:21 [scrapy.middleware] INFO: Enabled extensions:
[‘scrapy.extensions.corestats.CoreStats’,
‘scrapy.extensions.telnet.TelnetConsole’,
‘scrapy.extensions.logstats.LogStats’]
2021-10-05 15:48:22 [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-10-05 15:48:22 [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-10-05 15:48:22 [scrapy.middleware] INFO: Enabled item pipelines:
[‘ArticleSpider.pipelines.ArticlespiderPipeline’]
2021-10-05 15:48:22 [scrapy.core.engine] INFO: Spider opened
2021-10-05 15:48:22 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2021-10-05 15:48:22 [scrapy.extensions.telnet] INFO: Telnet console listening on 127.0.0.1:6023
2021-10-05 15:48:22 [uc] DEBUG: created a temporary folder in which the user-data (profile) will be stored during this
session, and added it to chrome startup arguments: --user-data-dir=C:\Users\34057\AppData\Local\Temp\tmp58nxhl4l
2021-10-05 15:48:22 [uc] DEBUG: did not find a bad exit_type flag
2021-10-05 15:48:23 [selenium.webdriver.remote.remote_connection] DEBUG: POST http://localhost:57814/session {“capabilities”: {“firstMatch”: [{}], “alwaysMatch”: {“browserName”: “chrome”, “platformName”: “any”, “pageLoadStrategy”: “normal”, “goog:chromeOptions”: {“extensions”: [], “binary”: “C:\Users\34057\AppData\Local\Google\Chrome\Application\chrome.exe”, “args”: ["–remote-debugging-host=127.0.0.1", “–remote-debugging-port=57813”, “–user-data-dir=C:\Users\34057\AppData\Local\Temp\tmp58nxhl4l”, “–lang=zh-CN”, “–log-level=0”], “debuggerAddress”: “127.0.0.1:57813”}}}, “desiredCapabilities”: {“browserName”: “chrome”, “version”: “”, “platform”: “ANY”, “pageLoadStrategy”: “normal”, “goog:chromeOptions”: {“extensions”: [], “binary”: “C:\Users\34057\AppData\Local\Google\Chrome\Application\chrome.exe”, “args”: ["–remote-debugging-host=127.0.0.1", “–remote-debugging-port=57813”, “–user-data-dir=C:\Users\34057\AppData\Local\Temp\tmp58nxhl4l”, “–lang=zh-CN”, “–log-level=0”], “debuggerAddress”: “127.0.0.1:57813”}}}
2021-10-05 15:48:23 [urllib3.connectionpool] DEBUG: Starting new HTTP connection (1): localhost:57814
2021-10-05 15:48:23 [urllib3.connectionpool] DEBUG: http://localhost:57814 “POST /session HTTP/1.1” 200 666
2021-10-05 15:48:23 [selenium.webdriver.remote.remote_connection] DEBUG: Finished Request
2021-10-05 15:48:23 [selenium.webdriver.remote.remote_connection] DEBUG: POST http://localhost:57814/session/9f2ca5f3981ea51b37be995a72d9c74c/url {“url”: “http://account.cnblogs.com/signin”}
2021-10-05 15:48:28 [urllib3.connectionpool] DEBUG: http://localhost:57814 “POST /session/9f2ca5f3981ea51b37be995a72d9c74c/url HTTP/1.1” 200 14
2021-10-05 15:48:28 [selenium.webdriver.remote.remote_connection] DEBUG: Finished Request
2021-10-05 15:48:28 [selenium.webdriver.remote.remote_connection] DEBUG: GET http://localhost:57814/session/9f2ca5f3981ea51b37be995a72d9c74c/cookie {}
2021-10-05 15:48:28 [urllib3.connectionpool] DEBUG: http://localhost:57814 “GET /session/9f2ca5f3981ea51b37be995a72d9c74c/cookie HTTP/1.1” 200 1453
2021-10-05 15:48:28 [selenium.webdriver.remote.remote_connection] DEBUG: Finished Request
2021-10-05 15:48:28 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://news.cnblogs.com/> (referer: None)
2021-10-05 15:48:28 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting (302) to <GET https://account.cnblogs.com:443/signin?ReturnUrl=https%3A%2F%2Fnews.cnblogs.com%2Fn%2F703387%2F> from <GET https://news.cnblogs.com/n/703387/>
2021-10-05 15:48:28 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://account.cnblogs.com:443/signin?ReturnUrl=https%3A%2F%2Fnews.cnblogs.com%2Fn%2F703387%2F> (referer: https://news.cnblogs.com/)
2021-10-05 15:48:29 [scrapy.core.scraper] ERROR: Spider error processing <GET https://account.cnblogs.com:443/signin?ReturnUrl=https%3A%2F%2Fnews.cnblogs.com%2Fn%2F703387%2F> (referer: https://news.cnblogs.com/)
Traceback (most recent call last):
File “D:\envs\article_spider\lib\site-packages\scrapy\utils\defer.py”, line 120, in iter_errback
yield next(it)
File “D:\envs\article_spider\lib\site-packages\scrapy\utils\python.py”, line 353, in next
return next(self.data)
File “D:\envs\article_spider\lib\site-packages\scrapy\utils\python.py”, line 353, in next
return next(self.data)
File “D:\envs\article_spider\lib\site-packages\scrapy\core\spidermw.py”, line 56, in _evaluate_iterable
for r in iterable:
File “D:\envs\article_spider\lib\site-packages\scrapy\spidermiddlewares\offsite.py”, line 29, in process_spider_output
for x in result:
File “D:\envs\article_spider\lib\site-packages\scrapy\core\spidermw.py”, line 56, in _evaluate_iterable
for r in iterable:
File “D:\envs\article_spider\lib\site-packages\scrapy\spidermiddlewares\referer.py”, line 342, in
return (_set_referer® for r in result or ())
File “D:\envs\article_spider\lib\site-packages\scrapy\core\spidermw.py”, line 56, in _evaluate_iterable
for r in iterable:
File “D:\envs\article_spider\lib\site-packages\scrapy\spidermiddlewares\urllength.py”, line 40, in
return (r for r in result or () if _filter®)
File “D:\envs\article_spider\lib\site-packages\scrapy\core\spidermw.py”, line 56, in _evaluate_iterable
for r in iterable:
File “D:\envs\article_spider\lib\site-packages\scrapy\spidermiddlewares\depth.py”, line 58, in
return (r for r in result or () if _filter®)
File “D:\envs\article_spider\lib\site-packages\scrapy\core\spidermw.py”, line 56, in _evaluate_iterable
for r in iterable:
File “C:\Users\34057\ArticleSpider\ArticleSpider\spiders\jobbole.py”, line 68, in parse_detail
data_re = re.match(r".?(\d+.)", create_data)
File “D:\envs\article_spider\lib\re.py”, line 173, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like object
2021-10-05 15:48:29 [scrapy.core.engine] INFO: Closing spider (finished)
2021-10-05 15:48:29 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{‘downloader/request_bytes’: 2374,
‘downloader/request_count’: 3,
‘downloader/request_method_count/GET’: 3,
‘downloader/response_bytes’: 17956,
‘downloader/response_count’: 3,
‘downloader/response_status_count/200’: 2,
‘downloader/response_status_count/302’: 1,
‘elapsed_time_seconds’: 6.768324,
‘finish_reason’: ‘finished’,
‘finish_time’: datetime.datetime(2021, 10, 5, 7, 48, 29, 74301),
‘httpcompression/response_bytes’: 82664,
‘httpcompression/response_count’: 2,
‘log_count/DEBUG’: 15,
‘log_count/ERROR’: 1,
‘log_count/INFO’: 10,
‘request_depth_max’: 1,
‘response_received_count’: 2,
‘scheduler/dequeued’: 3,
‘scheduler/dequeued/memory’: 3,
‘scheduler/enqueued’: 3,
‘scheduler/enqueued/memory’: 3,
‘spider_exceptions/TypeError’: 1,
‘start_time’: datetime.datetime(2021, 10, 5, 7, 48, 22, 305977)}
2021-10-05 15:48:29 [scrapy.core.engine] INFO: Spider closed (finished)
2021-10-05 15:48:29 [uc] DEBUG: closing webdriver
2021-10-05 15:48:29 [uc] DEBUG: killing browser
2021-10-05 15:48:29 [uc] DEBUG: removing profile : C:\Users\34057\AppData\Local\Temp\tmp58nxhl4l
2021-10-05 15:48:29 [uc] DEBUG: permission error. files are still in use/locked. retying…
2021-10-05 15:48:29 [uc] DEBUG: removing profile : C:\Users\34057\AppData\Local\Temp\tmp58nxhl4l
1回答
-
bobby
2021-10-07
这里是要登录,你先登陆然后继续试试
022021-10-08
相似问题