鱼C论坛

 找回密码
 立即注册
查看: 1941|回复: 3

scrapy爬虫运行无错误写入pymysql无数据

[复制链接]
发表于 2020-12-16 22:06:54 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
2020-12-16 21:56:25 [scrapy.utils.log] INFO: Scrapy 2.4.0 started (bot: dangdang)
2020-12-16 21:56:25 [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.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit
(AMD64)], pyOpenSSL 19.1.0 (OpenSSL 1.1.1h  22 Sep 2020), cryptography 3.2.1, Platform Windows-10-10.0.18362-SP
0
2020-12-16 21:56:25 [scrapy.utils.log] DEBUG: Using reactor: twisted.internet.selectreactor.SelectReactor
2020-12-16 21:56:26 [scrapy.crawler] INFO: Overridden settings:
{'BOT_NAME': 'dangdang',
'NEWSPIDER_MODULE': 'dangdang.spiders',
'ROBOTSTXT_OBEY': True,
'SPIDER_MODULES': ['dangdang.spiders']}
2020-12-16 21:56:26 [scrapy.extensions.telnet] INFO: Telnet Password: e464c9e14060c46a
2020-12-16 21:56:26 [scrapy.middleware] INFO: Enabled extensions:
['scrapy.extensions.corestats.CoreStats',
'scrapy.extensions.telnet.TelnetConsole',
'scrapy.extensions.logstats.LogStats']
2020-12-16 21:56:28 [scrapy.middleware] INFO: Enabled downloader middlewares:
['scrapy.downloadermiddlewares.robotstxt.RobotsTxtMiddleware',
'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-12-16 21:56:28 [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-12-16 21:56:28 [scrapy.middleware] INFO: Enabled item pipelines:
['dangdang.pipelines.DangdangPipeline']
2020-12-16 21:56:28 [scrapy.core.engine] INFO: Spider opened
2020-12-16 21:56:28 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0
items/min)
2020-12-16 21:56:28 [scrapy.extensions.telnet] INFO: Telnet console listening on 127.0.0.1:6023
2020-12-16 21:56:28 [scrapy.core.engine] DEBUG: Crawled (200) <GET http://category.dangdang.com/robots.txt> (re
ferer: None)
2020-12-16 21:56:29 [scrapy.core.engine] DEBUG: Crawled (200) <GET http://category.dangdang.com/pg1-cid4008154.
html> (referer: None)
2020-12-16 21:56:29 [scrapy.core.scraper] DEBUG: Scraped from <200 http://category.dangdang.com/pg1-cid4008154.
html>
{'comment': ['14条评论',---
            
'link': ['http://product.dangdang.com/1305516509.html',
         
'title': [' 初语2019春夏季新款超仙防晒衣开衫女空调罩衫中长款宽松外搭外套',
         
2020-12-16 21:56:29 [scrapy.core.engine] DEBUG: Crawled (200) <GET http://category.dangdang.com/pg2-cid4008154.
html> (referer: http://category.dangdang.com/pg1-cid4008154.html)
2020-12-16 21:56:29 [scrapy.core.scraper] DEBUG: Scraped from <200 http://category.dangdang.com/pg2-cid4008154.
html>
{'comment': ['456条评论',
           
'link': ['http://product.dangdang.com/1179052089.html',
         
'title': [' 【1件3折价:62.7,19日0点可叠券】美特斯邦威夹克女韩版织带装饰上衣个性时尚短外套秋装新款',
         
2020-12-16 21:56:29 [scrapy.dupefilters] DEBUG: Filtered duplicate request: <GET http://category.dangdang.com/p
g2-cid4008154.html> - no more duplicates will be shown (see DUPEFILTER_DEBUG to show all duplicates)
2020-12-16 21:56:29 [scrapy.core.engine] INFO: Closing spider (finished)
2020-12-16 21:56:29 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{'downloader/request_bytes': 896,
'downloader/request_count': 3,
'downloader/request_method_count/GET': 3,
'downloader/response_bytes': 107504,
'downloader/response_count': 3,
'downloader/response_status_count/200': 3,
'dupefilter/filtered': 1,
'elapsed_time_seconds': 1.817108,
'finish_reason': 'finished',
'finish_time': datetime.datetime(2020, 12, 16, 13, 56, 29, 937981),
'item_scraped_count': 2,
'log_count/DEBUG': 6,
'log_count/INFO': 10,
'request_depth_max': 2,
'response_received_count': 3,
'robotstxt/request_count': 1,
'robotstxt/response_count': 1,
'robotstxt/response_status_count/200': 1,
'scheduler/dequeued': 2,
'scheduler/dequeued/memory': 2,
'scheduler/enqueued': 2,
'scheduler/enqueued/memory': 2,
'start_time': datetime.datetime(2020, 12, 16, 13, 56, 28, 120873)}
2020-12-16 21:56:29 [scrapy.core.engine] INFO: Spider closed (finished)
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2020-12-16 22:07:47 | 显示全部楼层
运行代码如上,输出数据库中没办法查询到数据
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-12-16 22:26:51 | 显示全部楼层
where is your codes?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-12-17 22:27:36 | 显示全部楼层

就是插入不进去数据库,是有数据的,请帮忙分析一下,谢谢

dangdang.zip

8.34 KB, 下载次数: 3

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-1-17 00:08

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表