wdzj_platdata_spider.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:spider_wdzj_com 作者: basicworld 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号