首页 > scrapy 通过xpath helper插件可以获取到数据 在程序中却获取为[] 空

scrapy 通过xpath helper插件可以获取到数据 在程序中却获取为[] 空

代码 如下:

class SeriesSpider(scrapy.Spider):

name = "series"
allowed_domains = ['sohu.com']

def start_requests(self):
    yield Request('http://audi.auto.sohu.com',
                  meta={'brand_id': 191},
                  callback=self.parse)

def parse(self, response):
    brand_id = response.meta['brand_id']
    sel = Selector(response)
    serieses = sel.xpath('//*[@id="myTable111"]/tbody/tr/td[@class="bg"]/a')

    print serieses.extract()
    

已找到问题原因,要获取的内容是js里的;

暂时还没有想到好的方法怎么去获取这些数据!

【热门文章】
【热门文章】