老师,看视频检查了好几遍,该怎么解决呢

来源:4-20 异步方式入库mysql

慕网Yellow_Peach

2021-10-07

D:\envs\article_spider\Scripts\python.exe C:/Users/34057/ArticleSpider/main.py
2021-10-07 15:01:46 [scrapy.utils.log] INFO: Scrapy 2.5.0 started (bot: ArticleSpider)
2021-10-07 15:01:46 [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-07 15:01:46 [scrapy.utils.log] DEBUG: Using reactor: twisted.internet.selectreactor.SelectReactor
2021-10-07 15:01:46 [scrapy.crawler] INFO: Overridden settings:
{‘BOT_NAME’: ‘ArticleSpider’,
‘NEWSPIDER_MODULE’: ‘ArticleSpider.spiders’,
‘SPIDER_MODULES’: [‘ArticleSpider.spiders’]}
2021-10-07 15:01:46 [scrapy.extensions.telnet] INFO: Telnet Password: e78f1648bc62ab3a
2021-10-07 15:01:46 [scrapy.middleware] INFO: Enabled extensions:
[‘scrapy.extensions.corestats.CoreStats’,
‘scrapy.extensions.telnet.TelnetConsole’,
‘scrapy.extensions.logstats.LogStats’]
2021-10-07 15:01:46 [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-07 15:01:46 [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-07 15:01:46 [scrapy.middleware] INFO: Enabled item pipelines:
[‘ArticleSpider.pipelines.ArticleImagePipeline’,
‘ArticleSpider.pipelines.JsonExporterPipeline’,
‘ArticleSpider.pipelines.MysqlTwistedPipeline’,
‘ArticleSpider.pipelines.ArticlespiderPipeline’]
2021-10-07 15:01:46 [scrapy.core.engine] INFO: Spider opened
2021-10-07 15:01:47 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2021-10-07 15:01:47 [scrapy.extensions.telnet] INFO: Telnet console listening on 127.0.0.1:6023
2021-10-07 15:01:47 [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\tmp0egvnmmi
2021-10-07 15:01:47 [uc] DEBUG: did not find a bad exit_type flag
2021-10-07 15:01:48 [selenium.webdriver.remote.remote_connection] DEBUG: POST http://localhost:61302/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=61301”, “–user-data-dir=C:\Users\34057\AppData\Local\Temp\tmp0egvnmmi”, “–lang=zh-CN”, “–log-level=0”], “debuggerAddress”: “127.0.0.1:61301”}}}, “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=61301”, “–user-data-dir=C:\Users\34057\AppData\Local\Temp\tmp0egvnmmi”, “–lang=zh-CN”, “–log-level=0”], “debuggerAddress”: “127.0.0.1:61301”}}}
2021-10-07 15:01:48 [urllib3.connectionpool] DEBUG: Starting new HTTP connection (1): localhost:61302
2021-10-07 15:01:48 [urllib3.connectionpool] DEBUG: http://localhost:61302 “POST /session HTTP/1.1” 200 666
2021-10-07 15:01:48 [selenium.webdriver.remote.remote_connection] DEBUG: Finished Request
2021-10-07 15:01:48 [selenium.webdriver.remote.remote_connection] DEBUG: POST http://localhost:61302/session/03729a6f7547fc443547b0f55b2b980b/url {“url”: “http://account.cnblogs.com/signin”}
2021-10-07 15:02:23 [urllib3.connectionpool] DEBUG: http://localhost:61302 “POST /session/03729a6f7547fc443547b0f55b2b980b/url HTTP/1.1” 200 14
2021-10-07 15:02:23 [selenium.webdriver.remote.remote_connection] DEBUG: Finished Request
回车继续:
2021-10-07 15:02:25 [selenium.webdriver.remote.remote_connection] DEBUG: GET http://localhost:61302/session/03729a6f7547fc443547b0f55b2b980b/cookie {}
2021-10-07 15:02:25 [urllib3.connectionpool] DEBUG: http://localhost:61302 “GET /session/03729a6f7547fc443547b0f55b2b980b/cookie HTTP/1.1” 200 1504
2021-10-07 15:02:25 [selenium.webdriver.remote.remote_connection] DEBUG: Finished Request
2021-10-07 15:02:25 [uc] DEBUG: closing webdriver
2021-10-07 15:02:25 [uc] DEBUG: killing browser
2021-10-07 15:02:25 [uc] DEBUG: removing profile : C:\Users\34057\AppData\Local\Temp\tmp0egvnmmi
2021-10-07 15:02:30 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://news.cnblogs.com/> (referer: None)
2021-10-07 15:02:30 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://news.cnblogs.com/n/703440/> (referer: https://news.cnblogs.com/)
2021-10-07 15:02:30 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://news.cnblogs.com/NewsAjax/GetAjaxNewsInfo?contentId=703440> (referer: https://news.cnblogs.com/n/703440/)
2021-10-07 15:02:30 [scrapy.pipelines.files] DEBUG: File (uptodate): Downloaded image from <GET https://images0.cnblogs.com/news_topic/ITblog.jpg> referred in
2021-10-07 15:02:30 [scrapy.core.scraper] DEBUG: Scraped from <200 https://news.cnblogs.com/NewsAjax/GetAjaxNewsInfo?contentId=703440>
None
2021-10-07 15:02:30 [scrapy.core.engine] INFO: Closing spider (finished)
2021-10-07 15:02:30 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{‘downloader/request_bytes’: 4211,
‘downloader/request_count’: 3,
‘downloader/request_method_count/GET’: 3,
‘downloader/response_bytes’: 28519,
‘downloader/response_count’: 3,
‘downloader/response_status_count/200’: 3,
‘elapsed_time_seconds’: 43.898501,
‘file_count’: 1,
‘file_status_count/uptodate’: 1,
‘finish_reason’: ‘finished’,
‘finish_time’: datetime.datetime(2021, 10, 7, 7, 2, 30, 906846),
‘httpcompression/response_bytes’: 111744,
‘httpcompression/response_count’: 3,
‘item_scraped_count’: 1,
‘log_count/DEBUG’: 20,
‘log_count/INFO’: 10,
‘request_depth_max’: 2,
‘response_received_count’: 3,
‘scheduler/dequeued’: 3,
‘scheduler/dequeued/memory’: 3,
‘scheduler/enqueued’: 3,
‘scheduler/enqueued/memory’: 3,
‘start_time’: datetime.datetime(2021, 10, 7, 7, 1, 47, 8345)}
2021-10-07 15:02:30 [scrapy.core.engine] INFO: Spider closed (finished)
[Failure instance: Traceback: <class ‘TypeError’>: connect() argument 1 must be str, not tuple
D:\Python37\Lib\threading.py:917:_bootstrap_inner
D:\Python37\Lib\threading.py:865:run
D:\envs\article_spider\lib\site-packages\twisted_threads_threadworker.py:47:work
D:\envs\article_spider\lib\site-packages\twisted_threads_team.py:181:doWork
— —
D:\envs\article_spider\lib\site-packages\twisted\python\threadpool.py:238:inContext
D:\envs\article_spider\lib\site-packages\twisted\python\threadpool.py:255:
D:\envs\article_spider\lib\site-packages\twisted\python\context.py:118:callWithContext
D:\envs\article_spider\lib\site-packages\twisted\python\context.py:83:callWithContext
D:\envs\article_spider\lib\site-packages\twisted\enterprise\adbapi.py:443:runInteraction
D:\envs\article_spider\lib\site-packages\twisted\enterprise\adbapi.py:35:init
D:\envs\article_spider\lib\site-packages\twisted\enterprise\adbapi.py:72:reconnect
D:\envs\article_spider\lib\site-packages\twisted\enterprise\adbapi.py:413:connect
D:\envs\article_spider\lib\site-packages\MySQLdb_init
.py:130:Connect
D:\envs\article_spider\lib\site-packages\MySQLdb\connections.py:185:init
]

进程已结束,退出代码为 0

写回答

1回答

bobby

2021-10-08

从这里来看已经抓取到数据了?有没有打断点看看是否进入parse和parse_detail逻辑了

0
3
bobby
回复
慕网Yellow_Peach
好的。。
2021-10-09
共3条回复

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

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

5796 学习 · 6290 问题

查看课程