2017-10-05 5 views
-1

Scrapy을 사용하여 Quora 답변을 다운로드하려고하지만 내 페이지를 다운로드 할 수없는 것 같습니다. 이 오류Scrapy를 사용하여 모든 Quora 응답을 다운로드하려면 어떻게해야합니까?

2017-10-05 22:16:52 [scrapy.utils.log] INFO: Scrapy 1.4.0 started (bot: quora) 
2017-10-05 22:16:52 [scrapy.utils.log] INFO: Overridden settings: {'NEWSPIDER_MODULE': 'quora.spiders', 'ROBOTSTXT_OBEY': True, 'DUPEFILTER_CLASS': 'scrapy.dupefilters.BaseDupeFilter', 'SPIDER_MODULES': \[quora.spiders'], 'BOT_NAME': 'quora', 'LOGSTATS_INTERVAL': 0} 
.... 
2017-10-05 22:16:53 [scrapy.middleware] INFO: Enabled item pipelines: 
[] 
2017-10-05 22:16:53 [scrapy.extensions.telnet] DEBUG: Telnet console listening on 127.0.0.1:6023 
2017-10-05 22:16:53 [scrapy.core.engine] INFO: Spider opened 
2017-10-05 22:16:54 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting (301) to <GET https://it.quora.com/robots.txt> from <GET http://it.quora.com/robots.txt> 
2017-10-05 22:16:55 [scrapy.core.engine] DEBUG: Crawled (429) <GET https://it.quora.com/robots.txt> (referer: None) 
2017-10-05 22:16:55 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting (301) to <GET https://it.quora.com/profile/Ferdinando-Randisi> from <GET http://it.quora.com/profile/Ferdinando-Randisi> 
2017-10-05 22:16:56 [scrapy.core.engine] DEBUG: Crawled (429) <GET https://it.quora.com/profile/Ferdinando-Randisi> (referer: None) 
2017-10-05 22:16:58 [root] DEBUG: Using default logger 

문제점은 무엇입니까 간단한

scrapy shell 'http://it.quora.com/profile/Ferdinando-Randisi' 

수익률을 사용하십니까? 오류 429는 너무 많은 요청과 관련되어 있지만 은 하나만 요청입니다. 왜 그렇게 많을까요?

+0

[robots.txt'] (https://www.quora.com/robots.txt)를 읽어보십시오. – tadman

+0

내가 한 일은 있지만 너무 관련성이없는 내용은 없었습니다. 검색 엔진을 사용하면 사람들에게 알려야하는 이유에 대해 작성하고 사람들이 모든 사람의 콘텐츠를 다운로드하지 못하게하는 이유를 설명합니다. 나는 그 일을하지 않고, 나는 단지 내 대답을 원한다. –

+0

무슨 일이 일어나는지 보려면 '컬 (curl)'을 시도하십시오. – tadman

답변

4

사용자 에이전트 문자열을 기준으로 치료를 차단합니다. 예를 들어 모방하려고 시도하십시오. Chromium :

scrapy shell "http://it.quora.com/profile/Ferdinando-Randisi" -s USER_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.52 Safari/537.36" 
+0

그게 효과가! 건배 :) –