def parse(self, response):
    if (not isinstance(response, HtmlResponse)):
        return
    hxs = HtmlXPathSelector(response)
    categories = hxs.select(u'//nav[@class="cat"]/ul/li/ul/li/a/@href').extract()
    for url in categories:
        url = urljoin_rfc(get_base_url(response), (url + u'?sort=titledesc'))
        (yield Request(url))
    next_page = hxs.select(u'//a[@class="nxt"]/@href').extract()
    if next_page:
        next_page = urljoin_rfc(get_base_url(response), next_page[0])
        (yield Request(next_page))
    products = hxs.select(u'//div[@class="products"]//a/@href').extract()
    for url in products:
        url = urljoin_rfc(get_base_url(response), url)
        (yield Request(url, callback=self.parse_product))
def parse(self, response):
    if (not isinstance(response, HtmlResponse)):
        return
    hxs = HtmlXPathSelector(response)
    categories = hxs.select(u'//nav[@class="cat"]/ul/li/ul/li/a/@href').extract()
    for url in categories:
        url = urljoin_rfc(get_base_url(response), (url + u'?sort=titledesc'))
        (yield Request(url))
    next_page = hxs.select(u'//a[@class="nxt"]/@href').extract()
    if next_page:
        next_page = urljoin_rfc(get_base_url(response), next_page[0])
        (yield Request(next_page))
    products = hxs.select(u'//div[@class="products"]//a/@href').extract()
    for url in products:
        url = urljoin_rfc(get_base_url(response), url)
        (yield Request(url, callback=self.parse_product))