E
E
Eva052016-09-08 16:02:55
Python
Eva05, 2016-09-08 16:02:55

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.
d69f8f78ca75458f8a48a16bee6f3d39.png
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

1 answer(s)
A
Alexey Cheremisin, 2016-09-08
@leahch

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 question

Ask a Question

731 491 924 answers to any question