Blocking is stateful
IP reputation, TLS and HTTP fingerprints, cookies, request cadence, and behavior can all influence challenges.
Engineering guide
Learn the engineering tradeoffs of scraping Google SERPs: blocking, CAPTCHAs, proxies, parsing, localization, pagination, and when to use a SERP API.
import requests
from bs4 import BeautifulSoup
response = requests.get(
"https://www.google.com/search",
params={"q": "best trail shoes", "hl": "en", "gl": "us"},
headers={"User-Agent": "Mozilla/5.0 (...)"},
timeout=20,
)
soup = BeautifulSoup(response.text, "html.parser")
for node in soup.select("div.g"):
heading = node.select_one("h3")
link = node.select_one("a[href]")
if heading and link:
print(heading.get_text(" ", strip=True), link["href"])gl, hl, and encoded geographic context can produce different SERPs.For a deeper cost model, read the existing build-vs-buy analysis. For Python-specific instruction, the existing direct scraping tutorial stays the detailed editorial guide.
Create an account, get 25 free credits, and test live Google or Bing results. No credit card or subscription required.