非常简单的scrapy代码但就是不清楚到底哪里出问题了,高手帮忙看看吧!

bug 专栏收录该内容
1 篇文章 0 订阅

代码结构很简单,校对过,是根据这篇实践文章模仿的 https://mp.weixin.qq.com/s/t3xM0-YxKNwGI5A3EI26ew,是一名小白,求大神指教,万分感谢,在线等待

2019-03-22 13:45:05 [scrapy.utils.log] INFO: Versions: lxml 4.3.2.0, libxml2 2.9.5, cssselect 1.0.3, parsel 1.5.1, w3lib 1.20.0, Twisted 18.9.0, Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)], pyOpenSSL 19.0.0 (OpenSSL 1.1.1b 26 Feb 2019), cryptography 2.6.1, Platform Windows-10-10.0.17134-SP0
2019-03-22 13:45:05 [scrapy.crawler] INFO: Overridden settings: {‘BOT_NAME’: ‘weixin_moment’, ‘FEED_FORMAT’: ‘json’, ‘FEED_URI’: ‘moment.json’, ‘NEWSPIDER_MODULE’: ‘weixin_moment.spiders’, ‘ROBOTSTXT_OBEY’: True, ‘SPIDER_MODULES’: [‘weixin_moment.spiders’]}
2019-03-22 13:45:05 [scrapy.extensions.telnet] INFO: Telnet Password: d372339e76451fa8
2019-03-22 13:45:05 [scrapy.middleware] INFO: Enabled extensions:
[‘scrapy.extensions.corestats.CoreStats’,
‘scrapy.extensions.telnet.TelnetConsole’,
‘scrapy.extensions.feedexport.FeedExporter’,
‘scrapy.extensions.logstats.LogStats’]
2019-03-22 13:45:05 [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’]
2019-03-22 13:45:05 [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’]
2019-03-22 13:45:05 [scrapy.middleware] INFO: Enabled item pipelines:
[‘weixin_moment.pipelines.WeixinMomentPipeline’]
2019-03-22 13:45:05 [scrapy.core.engine] INFO: Spider opened
2019-03-22 13:45:05 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2019-03-22 13:45:05 [scrapy.extensions.telnet] INFO: Telnet console listening on 127.0.0.1:6023
2019-03-22 13:45:05 [scrapy.core.engine] DEBUG: Crawled (404) <GET https://chushu.la/robots.txt> (referer: None)
2019-03-22 13:45:05 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://chushu.la/api/book/chushula-{0}?isAjax=1> (referer: https://chushu.la/book/chushula-{0})
2019-03-22 13:45:06 [scrapy.core.scraper] ERROR: Spider error processing <GET https://chushu.la/api/book/chushula-[0}?isAjax=1> (referer: https://chushu.la/book/chushula-{0})
Traceback (most recent call last):
File “d:\python\lib\site-packages\twisted\internet\defer.py”, line 654, in runCallbacks
current.result = callback(current.result, *args, **kw)
File "d:\python\lib\site-packages\scrapy\spiders_init
.py", line 90, in parse
raise NotImplementedError(’{}.parse callback is not defined’.format(self.class.name))
NotImplementedError: AmomentSpider.parse callback is not defined
2019-03-22 13:45:06 [scrapy.core.engine] INFO: Closing spider (finished)
2019-03-22 13:45:06 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{‘downloader/request_bytes’: 664,
‘downloader/request_count’: 2,
‘downloader/request_method_count/GET’: 2,
‘downloader/response_bytes’: 4214,
‘downloader/response_count’: 2,
‘downloader/response_status_count/200’: 1,
‘downloader/response_status_count/404’: 1,
‘finish_reason’: ‘finished’,
‘finish_time’: datetime.datetime(2019, 3, 22, 5, 45, 6, 198382),
‘log_count/DEBUG’: 2,
‘log_count/ERROR’: 1,
‘log_count/INFO’: 9,
‘response_received_count’: 2,
‘robotstxt/request_count’: 1,
‘robotstxt/response_count’: 1,
‘robotstxt/response_status_count/404’: 1,
‘scheduler/dequeued’: 1,
‘scheduler/dequeued/memory’: 1,
‘scheduler/enqueued’: 1,
‘scheduler/enqueued/memory’: 1,
‘spider_exceptions/NotImplementedError’: 1,
‘start_time’: datetime.datetime(2019, 3, 22, 5, 45, 5, 836995)}
2019-03-22 13:45:06 [scrapy.core.engine] INFO: Spider closed (finished)

  • 0
    点赞
  • 1
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值