0

I am writing a Python script that can take a Facebook URL and locally save an html file of that Facebook page. Based on the answer to this question: Inherent way to save web page source

I tried using urllib2, but the resulting html file is different (missing some parts) compared to the html file that get from manually right clicking on the Facebook page and saving the entire webpage. Do you know why they would be different and what other Python libraries I could use instead of urllib2?

Community
  • 1
  • 1
Nancy
  • 1
  • 1
    You could share your code and perhaps we could help. But in terms of making http get requests from a python module, the modern preferred method is to use [http://docs.python-requests.org/en/master/](http://docs.python-requests.org/en/master/) – Shawn Mehan Oct 18 '16 at 22:21
  • 1
    FB uses JavaScript /AJAX to put data on page. You can't get it using urllib2/requests. You can try Selenium which use web browser to "render" page and run JavaScript. – furas Oct 18 '16 at 22:30
  • 3
    Facebook doesn't allow you to scrape them. Use the API – WizKid Oct 18 '16 at 22:30

0 Answers0