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

2018-03-01 11:19:33 +08:00
 dapengzhao

这是 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">
大数据生态系统的智能服务者。
1751 次点击
所在节点   2018
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/433816

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX