【问题标题】:unable to fetch facebook friend list using scrapy无法使用scrapy获取facebook好友列表
【发布时间】: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


【解决方案1】:

在[2]中:response.xpath('//div[@class="_3i9"]') 出[2]:[]

在[3]中:response.xpath('//div[@class="_3i9"]/div/a/@href') 出[3]:[]

在[4]中:response.xpath('//div[@class="_3i9"]/div/ul/li/a/@href') 出[4]:[]

在[5]中:response.xpath('//div[@class="clearfix _5qo4"]/a/@href') 出[5]:[]

在[6]中:response.xpath('//div[@class="clearfix _5qo4"]') 出[6]:[]

在[7]中:response.xpath('//div[@class="uiList _262m _4kg"]') 出[7]:[]

在[8]中:response.xpath('//ul[@class="uiList _262m _4kg"]') 出[8]:[]

在[9]中:response.xpath('//ul[@class="collection_wrapper_2356318349"]') 出[9]:[]

在[10]中:response.xpath('//[@class="collection_wrapper_2356318349"]') 分享编辑

【讨论】:

  • 你能解释一下吗??
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-11-15
  • 2015-03-16
  • 1970-01-01
  • 2014-06-19
  • 2015-08-30
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多