design_picture_spider.py 文件源码

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

项目:decoration-design-crawler 作者: imflyn 项目源码 文件源码
def parse_list(self, response):
        selector = Selector(response)
        items_selector = selector.xpath('//div[@class="xmp_container"]//div[@class="item"]')
        for item_selector in items_selector:
            # http://xiaoguotu.to8to.com/c10037052.html
            cid = item_selector.xpath('div//a/@href').extract()[0][2:-6]
            title = item_selector.xpath('div//a/@title').extract()[0]
            # http://xiaoguotu.to8to.com/getxgtjson.php?a2=0&a12=&a11=10037052&a1=0
            next_url = (constant.PROTOCOL_HTTP + self.start_url_domain + '/getxgtjson.php?a2=0&a12=&a11={cid}&a1=0').format(cid=cid)
            yield scrapy.Request(next_url, self.parse_content, meta={'cid': cid, 'title': title})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号