Answer the question
In order to leave comments, you need to log in
Data is lost when using the requests Python library, how to fix it?
Hey!
Decided to parse the "Friends" page (list of friends) of my friend on Facebook. When I click on View page code , I can see the names of his friends, their id, their page address, etc.
When I use
import requests
url=' https://www.facebook.com/gisachina/friends?pnref=lhc ' (address my friend's friends list page)
response = requests.get(url)
response.text
This data is no longer there, no name, no id, nothing about his friends data.
I'm new to the web, please tell me how to display exactly the same information in Python as when using View page code
Answer the question
In order to leave comments, you need to log in
You fail for the following reasons:
1) Data is loaded via ajax
2) Data is loaded only after authorization
3) You need to use the facebook API
4) And for this you need to register your application https://dev.facebook.com
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question