Facebook Graph Api:在Facebook中搜索名称



你好,我怎么可以在facebook图形api上搜索名称,比如"John Doe";而不是用户名或用户ID?感谢,我正在使用python的请求模块

不幸的是,facebook-graph API没有用于搜索用户的端点,但您可以简单地使用fb包进行登录,并使用模块facebook-scraper包自动进行搜索

搜索fb用户名

您可以使用cookie扩展名获取cookies.txt,该扩展名将本地cookie文件提取为文本。

from facebook_scraper import get_profile
get_profile("zuck") # Or get_profile("zuck", cookies="cookies.txt")
{'About': "I'm trying to make the world a more open place.",
'Education': 'Harvard Universityn'
'Computer Science and Psychologyn'
'30 August 2002 - 30 April 2004n'
'Phillips Exeter Academyn'
'Classicsn'
'School year 2002n'
'Ardsley High Schooln'
'High Schooln'
'September 1998 - June 2000',
'Favourite Quotes': '"Fortune favors the bold."n'
'- Virgil, Aeneid X.284n'
'n'
'"All children are artists. The problem is how to remain '
'an artist once you grow up."n'
'- Pablo Picasson'
'n'
'"Make things as simple as possible but no simpler."n'
'- Albert Einstein',
'Name': 'Mark Zuckerberg',
'Places lived': [{'link': '/profile.php?id=104022926303756&refid=17',
'text': 'Palo Alto, California',
'type': 'Current town/city'},
{'link': '/profile.php?id=105506396148790&refid=17',
'text': 'Dobbs Ferry, New York',
'type': 'Home town'}],
'Work': 'Chan Zuckerberg Initiativen'
'1 December 2015 - Presentn'
'Facebookn'
'Founder and CEOn'
'4 February 2004 - Presentn'
'Palo Alto, Californian'
'Bringing the world closer together.'}

信用:facebook scraper文档

最新更新