Using Smart Proxy Manager with Selenium Wire

Note

Selenium Wire requires Selenium python libraries and WebDriver installed.

Setup the Smart Proxy Manager Headless Proxy as described in Using Headless Browsers with Zyte Smart Proxy Manager.

Python code sample

Save the following code as a sample_script.py:

from seleniumwire import webdriver

headless_proxy = "http://127.0.0.1:3128"
seleniumwire_options = {
    "proxy": {"http": headless_proxy, "https": headless_proxy, "no_proxy": ""}
}
browser = webdriver.Chrome(seleniumwire_options=seleniumwire_options)
browser.get("https://toscrape.com")
browser.save_screenshot("screenshot.png")
browser.close()

Install Selenium Wire and run sample_script.py with:

$ pip install selenium-wire
$ python3 sample_script.py