在scrapy框架中利用inspect_response在cmd上进入shell
import scrapy from scrapy.shell import inspect_response class MySpider(scrapy.Spider): name = "example" start_urls = [ "http://example.org", ] def parse(self, response): inspect_response(response, self)
点击 ctrl-d退出终端,爬虫会从其停下的地方恢复爬取
不能使用fetch()命令