dzdp_spider.py 文件源码

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

项目:web-crawler-spider- 作者: Hardysong 项目源码 文件源码
def parse_location(self,response):

        loc_hxs = scrapy.Selector(response)
        loc_xs = loc_hxs.xpath('//div[@id="aside"]/script[1]').extract()[0]
        coord_text = re.findall(r'lng:\w+.\w+,lat:\w+.\w+',loc_xs)[0]

        item = response.meta['item']
        item['location'] = coord_text.encode('gbk')
        return item
        #print  coord_text
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号