dapengzhao
V2EX  ›  2018

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

  •  
  •   dapengzhao · Mar 1, 2018 · 2235 views
    This topic created in 2995 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   ·   5591 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 07:05 · PVG 15:05 · LAX 00:05 · JFK 03:05
    ♥ Do have faith in what you're doing.