V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
dapengzhao
V2EX  ›  2018

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

  •  
  •   dapengzhao · 2018-03-01 11:19:33 +08:00 · 1748 次点击
    这是一个创建于 2249 天前的主题,其中的信息可能已经有所发展或是发生改变。

    这是 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">
    大数据生态系统的智能服务者。
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5742 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 02:36 · PVG 10:36 · LAX 19:36 · JFK 22:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.