#coding: utf-8


def classiUrl_xpath(response):
    """
    extract url of all classi 
    from response of http://www.11315.com/rankAllList
    """
    sel = response.selector
    all_url = {}   #
    classi = sel.xpath(u"//dl[@class='sortdl']/dt/text()").extract()
    xpath_s = u"//dt[text()='{tag}']/following-sibling::*\
        /a/@href"
    all_url = {}
    for i in classi:
        # print 'fir', i
        xpath_s = u"//dt[text()='{tag}']/following-sibling::*\
                /a/@href"
        xpath_s = xpath_s.format(tag=unicode(i))
        all_url[i.strip()[:-1]] = sel.xpath(xpath_s).extract()

    return all_url
