Python 无法使用scrapy获取facebook好友列表 没有使用任何标记检索到输出

Python 无法使用scrapy获取facebook好友列表 没有使用任何标记检索到输出,python,facebook,scrapy,web-crawler,screen-scraping,Python,Facebook,Scrapy,Web Crawler,Screen Scraping,我正在尝试使用scrapy脚本获取用户的好友列表,我能够获取关于和其他基本信息部分的数据,但是对于好友部分,类似的代码似乎不起作用。我正在使用登录在浏览器中的facebook帐户,并且所需个人资料的好友列表也是公开的。我尝试了以下方法: In [2]: response.xpath('//div[@class="_3i9"]') Out[2]: [<Selector xpath='//div[@class="_3i9"]' data='<div

我正在尝试使用scrapy脚本获取用户的好友列表,我能够获取关于和其他基本信息部分的数据,但是对于好友部分,类似的代码似乎不起作用。我正在使用登录在浏览器中的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"]')
[2]中的
:response.xpath('//div[@class=“\u 3i9”]”)
输出[2]:[]
[3]中的response.xpath('//div[@class=“\u 3i9”]/div/a/@href')
输出[3]:[]
[4]:response.xpath('//div[@class=“\u 3i9”]/div/ul/li/a/@href'))
Out[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”]”)
Out[7]:[]
[8]中的response.xpath('//ul[@class=“uiList _262m _4kg”]”)
Out[8]:[]
[9]中的response.xpath('//ul[@class=“collection\u wrapper\u 2356318349”])
出[9]:[]
[10]中的response.xpath('/[@class=“collection\u wrapper\u 2356318349”]”)
[2]中的:response.xpath('//div[@class=“\u 3i9”]”)
输出[2]:[]

[3]中的response.xpath('//div[@class=“\u 3i9”]/div/a/@href') 输出[3]:[]

[4]:response.xpath('//div[@class=“\u 3i9”]/div/ul/li/a/@href')) Out[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”]”) Out[7]:[]

[8]中的response.xpath('//ul[@class=“uiList _262m _4kg”]”) Out[8]:[]

[9]中的response.xpath('//ul[@class=“collection\u wrapper\u 2356318349”]) 出[9]:[]

[10]中的response.xpath('/[@class=“collection\u wrapper\u 2356318349”]”)
共享编辑

Facebook不允许你刮去它们。除了wizkid所说的之外,你还必须使用APIs。这个用例是什么?我想知道,我们是否可以通过简单的HTML内容过滤,用例-开发一个小型的社交工具,你能解释一下吗??