How do I scrape pages from the Facebook About section. Can I use Facebook Graph API or should I use a Python web-scraping library like Scrappy of Beautiful Soup?
How do I scrape pages from the Facebook About section. Can I use Facebook Graph API or should I use a Python web-scraping library like Scrappy of Beautiful Soup?
The Facebook Graph API is for "apps to read and write to the Facebook social graph" so you cannot use it in this case. Instead, you should use a Python scraping-libary like beautifulsoup.
An example of scraping the Facebook About Page for the organizations mission statement might look like this:
from bs4 import BeautifulSoup
import requestsresponse = requests.get("https://www.facebook.com/pg/officialstackoverflow/about/?ref=page_internal")
html = response.content
soup = BeautifulSoup(html, "html")
mission_statement = soup.find('div', attrs={'class': '_3-8w'})
print(mission_statement.text)
> To make the internet a better place and be the best site to find expert answers to your programming questions.