쉘 중에 설정 모듈이로드되지 않았다고 생각합니다. 그것은 그것의 언급이없는
https://doc.scrapy.org/en/latest/topics/shell.html
아래의 설명서를 참조하십시오. 할 수있는 일은 DebugSpider를 생성하고 URL을 실행하고 디버깅 셸을 호출하는 것입니다. 그래서 이것은 또한 설정 모듈을로드 터미널 실행
scrapy crawl debug -a url="http://tarunlalwani.com"
에서
class DebugSpider(scrapy.Spider):
name = "debug"
def __init__(self, url=None):
if url is None:
raise Exception("Please specify a url using -a url=....")
self.start_urls = [url]
def parse(self, response):
from scrapy.shell import inspect_response
inspect_response(response, self)
그런 다음 거미 코드에 아래 추가 요청을하고 쉘 당신에게
2017-09-12 00:16:27 [scrapy.core.engine] DEBUG: Crawled (200) <GET http://tarunlalwani.com> (referer: None)
[s] Available Scrapy objects:
>>> [s] scrapy scrapy module (contains scrapy.Request, scrapy.Selector, etc)
[s] crawler <scrapy.crawler.Crawler object at 0x10562b748>
[s] item {}
[s] request <GET http://tarunlalwani.com>
[s] response <200 http://tarunlalwani.com>
[s] settings <scrapy.settings.Settings object at 0x106432c50>
[s] Useful shortcuts:
[s] shelp() Shell help (print this help)
[s] view(response) View response in a browser
을 동일 디버깅을 제공