dapengzhao
V2EX  ›  2018

scrapy shell 可以取到的数据,到 scrapy 爬虫却取不出来。有没有大神帮解决一下

  •  
  •   dapengzhao · Mar 1, 2018 · 2346 views
    This topic created in 3077 days ago, the information mentioned may be changed or developed.

    这是 scrapy shell In [34]: response.xpath('//div[@class="name"]/a/text()').extract() Out[34]: ['清博大数据']

    这是 scrapy 爬虫对应的字段 author = response.xpath('//div[@class="name"]/a/text()').extract()

    结果

    'Author': [], 'Category_ID': 0, 'Content': [], 'Favorites': 0, 'PublishTime': [], 'ReadCounts': 0, 'Source': '百家号', 'SourceType': '文化', 'Source_ID': 34,

    这是源代码

    <section id="content" class="content clearfix"> <aside class="aside">
    大数据生态系统的智能服务者。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5638 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 08:04 · PVG 16:04 · LAX 01:04 · JFK 04:04
    ♥ Do have faith in what you're doing.