为了账号安全,请及时绑定邮箱和手机立即绑定

scrapy crawl douban_spider 出错

2018-08-26 22:17:40 [scrapy.utils.log] INFO: Scrapy 1.5.1 started (bot: douban)
2018-08-26 22:17:40 [scrapy.utils.log] INFO: Versions: lxml 4.2.4.0, libxml2 2.9.5, cssselect 1.0.3, parsel 1.5.0, w3lib 1.19.0, Twisted 18.7.0, Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)], pyOpenSSL 18.0.0 (OpenSSL 1.1.0i  14 Aug 2018), cryptography 2.3.1, Platform Windows-7-6.1.7601-SP1
2018-08-26 22:17:40 [scrapy.crawler] INFO: Overridden settings: {'BOT_NAME': 'douban', 'NEWSPIDER_MODULE': 'douban.spiders', 'ROBOTSTXT_OBEY': True, 'SPIDER_MODULES': ['douban.spiders'], 'USER_AGENT': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36'}
2018-08-26 22:17:40 [scrapy.middleware] INFO: Enabled extensions:
['scrapy.extensions.corestats.CoreStats',
 'scrapy.extensions.telnet.TelnetConsole',
 'scrapy.extensions.logstats.LogStats']
2018-08-26 22:17:41 [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']
2018-08-26 22:17:41 [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']
2018-08-26 22:17:41 [scrapy.middleware] INFO: Enabled item pipelines:
[]
2018-08-26 22:17:41 [scrapy.core.engine] INFO: Spider opened
2018-08-26 22:17:41 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2018-08-26 22:17:41 [scrapy.extensions.telnet] DEBUG: Telnet console listening on 127.0.0.1:6023
2018-08-26 22:17:41 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://book.douban.com/robots.txt> (referer: None)
2018-08-26 22:17:41 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://book.douban.com/top250> (referer: None)
2018-08-26 22:17:41 [scrapy.core.engine] INFO: Closing spider (finished)
2018-08-26 22:17:41 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{'downloader/request_bytes': 619,
 'downloader/request_count': 2,
 'downloader/request_method_count/GET': 2,
 'downloader/response_bytes': 9998,
 'downloader/response_count': 2,
 'downloader/response_status_count/200': 2,
 'finish_reason': 'finished',
 'finish_time': datetime.datetime(2018, 8, 26, 14, 17, 41, 915743),
 'log_count/DEBUG': 3,
 'log_count/INFO': 7,
 'response_received_count': 2,
 'scheduler/dequeued': 1,
 'scheduler/dequeued/memory': 1,
 'scheduler/enqueued': 1,
 'scheduler/enqueued/memory': 1,
 'start_time': datetime.datetime(2018, 8, 26, 14, 17, 41, 367742)}
2018-08-26 22:17:41 [scrapy.core.engine] INFO: Spider closed (finished)

正在回答

3 回答

settings里设置
ROBOTSTXT_OBEY = False
0 回复 有任何疑惑可以回复我~
#1

咕咕哇

设置以后,还是报“2018-08-26 22:17:41 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://book.douban.com/top250> (referer: None)”这个错误,是什么原因呢?
2018-09-06 回复 有任何疑惑可以回复我~
#2

大壮老师 回复 咕咕哇

这个不是错误
2018-09-06 回复 有任何疑惑可以回复我~
#3

咕咕哇 回复 大壮老师

真是尴尬,弄错了,"UnicodeEncodeError: 'gbk' codec can't encode character '\xee' in position 22325: illegal multibyte sequence”这个编码问题
2018-09-06 回复 有任何疑惑可以回复我~
#4

大壮老师 回复 咕咕哇

你用的python几?
2018-09-06 回复 有任何疑惑可以回复我~
#5

ChenforCode 回复 大壮老师

加一 老师我的也是这个错误,gbk编码
2018-11-02 回复 有任何疑惑可以回复我~
#6

ChenforCode 回复 咕咕哇

我用git bash有这个问题,换了cmd就没有了
2018-11-02 回复 有任何疑惑可以回复我~
#7

高哥没有毒 回复 咕咕哇

请问gbk那个问题你是怎么解决的
2019-01-18 回复 有任何疑惑可以回复我~
查看4条回复

改成 false后,运行出来还是true,关不掉啊什么情况老师

0 回复 有任何疑惑可以回复我~

我也是这个原因 为什么啊

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

scrapy crawl douban_spider 出错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信