yield scrapy.Request(
company_href,
dont_filter=True,
cookies=cookies_dict,
callback=lambda response, company_href =company_href: self.detail_parse(response, company_href),
meta = {'company_href':company_href}
)
def detail_parse(self,response,company_href):
url = response.url
print(response.meta['company_href'])
print(company_href)
两种方法。
一、callback函数带参数
二、放在meta里面