def parse(self, response):#response为抓取返回的网页内容
item = Mypro1Item()
item['urlname'] = response.xpath("/html/head/title/text()")
urls = re.compile(r'[a-zA-Z]+://[^\s]*[.com|.cn]').findall(response)
for url in urls:
yield Request(url,callback=self.parse)
print(item['urlname'])
为什么实现不了递归处理。
不知道你这个问题是否已经解决, 如果还没有解决的话: