使用Python获取Facebook好友列表

0 投票
1 回答
1855 浏览
提问于 2025-04-16 00:14

我想知道怎么用Python登录Facebook,获取我的好友列表,然后用这些数据来查看我的朋友们是否是Facebook上的好友?

谢谢你的帮助 :-)

1 个回答

4

首先,你不能访问你朋友的朋友列表,除非他们自己允许你的应用程序这样做。

不过,你可以试试使用pyfacebook这个库,里面有一个叫friends.get()的方法,或者使用新的图形API。

https://graph.facebook.com/me/friends will get a list of your friends then
https://graph.facebook.com/{{ID}}/friends will get the friends of your friend with id {{ID}}

希望这对你有帮助。

撰写回答