def get_info(self, response):
item = baidu_item()
item["id"]=response.meta["id"]
item["name"]=response.meta["name"]
redirect_url_list = response.xpath("""//h3/a/@href""").extract()
for url in redirect_url_list:
if "http" in url or "https" in url:
scrapy.Request(url=url, headers=self.headers, timeout=5,meta={"item":item})
def parse(self, response):
item=response.meta["item"]
if self.filter_domain(response.url) == 0:
if len(re.findall("/", response.url)) <= 3:
if self.filter_figure(response.url):
if re.findall("[^/]+(?!.*/)", response.url):
if self.filter_figure(response.url):
item["url"]=[response.url]
now the situation is that I write a url rule when I loop, but if I can only pass one url, at a time according to item ["url"] = [response.url], how do I now pass the looped url to item [" url"]?