DEV Community

Dylan Parker
Dylan Parker

Posted on

Testing Google Local Search Results with Selenium + Proxies

Been experimenting with ways to test Google local SERPs without physically being in each target location.

One setup that worked reasonably well was combining Selenium with rotating proxies in a headless browser.

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('--proxy-server=http://your-proxy:port')
options.add_argument('--lang=en-US')

driver = webdriver.Chrome(options=options)
driver.get('https://www.google.com/search?q=hotels+near+me')

results = driver.find_elements_by_css_selector('.g')

for result in results[:5]:
print(result.text)

driver.quit()

A few issues I kept running into:

proxy instability
slower response times
inconsistent SERPs
Google detecting proxy traffic

Lately I’ve been testing API-level location spoofing instead, and the results have been much more consistent for SEO audits and competitor tracking.

https://serpspur.com

python #seo #selenium #automation

Top comments (0)