Requests & BeautifulSoup
Requests - API Data Fetching
import requests
response = requests.get("https://api.example.com/product-data")
print(response.json()) BeautifulSoup - Web Scraping
from bs4 import BeautifulSoup
import requests
response = requests.get("https://example.com/reviews")
soup = BeautifulSoup(response.text, "html.parser")
print(soup.title.text)
#-------------------------------------------------#
#BeatifulSoup converts the raw HTML into a structured object, making it easy to search.
soup.title # Finds the <title> tag
soup.body # Finds the <body> tag
soup.p # Finds the first <p> (paragraph) tagLast updated