【发布时间】:2018-06-16 04:57:22
【问题描述】:
没有使用任何标签检索到输出
我正在尝试使用 scrapy 脚本获取用户的好友列表,我能够获取 about 和其他基本信息部分的数据,但是对于朋友部分,类似的代码似乎不起作用。我正在使用我在浏览器中登录的 Facebook 帐户,所需个人资料的好友列表也是公开的。我已经尝试实现以下方法:
In [2]: response.xpath('//div[@class="_3i9"]')
Out[2]: [<Selector xpath='//div[@class="_3i9"]' data='<div id="collection_wrapper_2327158227" '>]
In [3]: response.xpath('//div[@class="_3i9"]/div/a/@href')
Out[3]: []
In [4]: response.xpath('//div[@class="_3i9"]/div/ul/li/a/@href')
Out[4]: []
In [5]: response.xpath('//div[@class="clearfix _5qo4"]/a/@href')
Out[5]: []
In [6]: response.xpath('//div[@class="clearfix _5qo4"]')
Out[6]: []
In [7]: response.xpath('//div[@class="uiList _262m _4kg"]')
Out[7]: []
In [8]: response.xpath('//ul[@class="uiList _262m _4kg"]')
Out[8]: []
In [9]: response.xpath('//ul[@class="collection_wrapper_2356318349"]')
Out[9]: []
In [10]: response.xpath('//[@class="collection_wrapper_2356318349"]')
【问题讨论】:
-
Facebook 不允许您抓取它们。您必须使用 API
-
在wizkid所说的旁边,这个用例是什么?
-
我想知道我们是否可以通过简单的 HTML 内容过滤来报废,用例 - 开发一个用于社交报废的小工具
标签: python facebook scrapy web-crawler screen-scraping