def parse(self, response):
for sel in response.xpath('//*[@id="tb_content"]/div[3]/table/tbody/tr'):
item = WangdaizhijiaItem()
item['pm'] = sel.xpath('td')[0].xpath('span/text()').extract()[0]
item['ptmc'] = sel.xpath('td/a[@target="_blank"]/span/text()').extract()
item['cjl'] = sel.xpath('td/text()').extract()[0]
item['pjll'] = sel.xpath('td/text()').extract()[1]
item['pjjkqx'] = sel.xpath('td/text()').extract()[2]
item['ljdhje'] = sel.xpath('td/text()').extract()[3]
yield item
# pm = scrapy.Field() #??
# ptmc = scrapy.Field() #????
# cjl = scrapy.Field() #???
# pjll = scrapy.Field() #????
# pjjkqx = scrapy.Field() # ??????
# ljdhje = scrapy.Field() #??????
# //*[@id="tb_content"]/div[3]/table/tbody
wdzj_platdata_spider.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录