Skip to content Skip to sidebar Skip to footer

Convert Lxml To Scrapy Xxs Selector

How can I convert this pure python lxml to scrapy built in xxs selectors? This one works but i want to convert this to the scrapy xxs selectors. def parse_device_list(self, res

Solution 1:

Give it a try:

def parse_page(self, response):
    xxs = XmlXPathSelector(response)
    for row in xxs.select('//row'):
        detail_page_link = row.select('.//cell[1]/@href')[0].extract()
        yield Request(urlparse.urljoin(response.url, detail_page_link), callback=self.parse_page)

Post a Comment for "Convert Lxml To Scrapy Xxs Selector"