facebook scraper in python

main.py
from bs4 import BeautifulSoup
import requests

url = 'https://www.facebook.com/'

# Send a GET request to the URL
response = requests.get(url)

# Parse the response content using BeautifulSoup
soup = BeautifulSoup(response.content, 'html.parser')

# Find and extract desired information from the HTML content
# For example, you could extract the page title
page_title = soup.title.text

print(page_title)
405 chars
17 lines

Note: Remember that web scraping Facebook is against Facebook's terms of service. Make sure to review the terms of service and always get permission before scraping any website.

related categories

gistlibby LogSnag