无法产生价值

时间:2019-01-29 17:05:22

标签: python for-loop xpath scrapy

无法产生代码中的值。 “猫”和“品牌”的长度相同,例如brands = {b1,b2,b3...b10} cats ={{c11,c12,c13..c1n}, {c21,c22...}..{c101,c102}}

    cats = response.xpath('//*[@class="leftNavCategoriesNodePopup"]')
    brands = response.xpath('//*[@class="leftNavCategoriesNode"]')
    for cat,brand in cats, brands:
        ca = cat.xpath('.//*[@class="leftNavCategoriesNodePopupColumn"]/a/@href').extract()
        br = brand.xpath('.//*[@class="leftNavCategoriesNodeName"]/text()').extract()
        for c in ca:
            yield{'br':br, 'c':c}

0 个答案:

没有答案