为什么不调用“ parse”方法?

时间:2019-10-26 16:12:42

标签: python python-3.x web-scraping scrapy

url带有附加路径https://www.businessesforsale.com/search时,

回调不会调用 parse 方法,但它可以与URL https://www.businessesforsale.com

一起使用
import scrapy
class MySpider(scrapy.Spider):
    name = 'test'
    allowed_domains = ['businessesforsale.com']

    def start_requests(self):
        yield scrapy.Request('https://www.businessesforsale.com/search', self.parse)


    def parse(self, response):
        print('Some actions...')

0 个答案:

没有答案