Ejemplo n.º 1
0
    def parse(self, response):
        response_selector = Selector(response)
        next_link = response_selector.select(u'//span[@class="next"]/a/@href').extract()[0]
        log.msg("jinxp next link is %s" % next_link, level=log.DEBUG)
        if next_link:
            next_link = clean_url(response.url,next_link,response.encoding)
            yield Request(url=next_link, callback=self.parse)

        for detail_link in response_selector.select(u'//table[@class="olt"]/tr[@class=""]/td[@class="title"]/a/@href').extract():
            if detail_link:
                detail_link = clean_url(response.url,detail_link,response.encoding)
                yield Request(url=detail_link, callback=self.parse_detail)                
Ejemplo n.º 2
0
    def parse(self, response):
        sel = Selector(response)

        for detail_link in sel.xpath('//ul[@class="browseLettersLinks"]/li/a/@href').extract():
            if detail_link:
                detail_link = clean_url(response.url, detail_link, response.encoding)

                yield Request(url=detail_link, callback=self.parse_detail)