scrapy 爬虫无法通过for循环
*def parse(self, response):
item=Job51Item()
data=response.body.decode("gbk")
item['position']=response.xpath('//div[@class="el"]/p/span/a/@title').extract()
item['company'] = response.xpath('//div[@class="el"]/span/a/@title').extract()
placepat='<div class="el">.*?<span class="t3">(.*?)</span>'
salarypat = '<div class="el">.*?<span class="t4">(.*?)</span>'
item['place']=re.findall(placepat,data,re.S)
item['salary']=re.findall(salarypat,data,re.S)
print(item['position'])
print(item['company'])
print(item['place'])
print(item['salary'])
yield (item)*
*for i in range(2,5):
url = 'http://search.51job.com/list/030200,000000,0000,00,