Skip to main content

A simple library to facilitate the use of proxies with Selenium and Python.

Project description

Selenium Proxy

A simple library to facilitate the use of proxies with Selenium and Python.

Installation

pip install selenium-proxy-utils

Usage

from selenium import webdriver
from selenium_proxy import add_proxy
from selenium_proxy.schemas import Proxy

# Define browser options
browser_options = webdriver.ChromeOptions()
browser_options.add_argument("--disable-logging")
browser_options.add_argument("--log-level=3")
browser_options.add_argument("--disable-infobars")

# Define proxy settings
proxy = {
    "host": "proxy_address",
    "port": 8000,
    "username": "user",
    "password": "password"
}

# Add proxy settings (supports authenticated proxies)
add_proxy(browser_options, proxy=Proxy(**proxy))

# Initialize WebDriver
driver = webdriver.Chrome(options=browser_options)
driver.get("https://google.com")

# Keep the browser open for 120 seconds
import time
time.sleep(120)

# Close the browser
driver.quit()

Requirements

  • Python 3.x
  • Selenium

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

selenium_proxy_utils-0.0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

selenium_proxy_utils-0.0.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file selenium_proxy_utils-0.0.1.tar.gz.

File metadata

  • Download URL: selenium_proxy_utils-0.0.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for selenium_proxy_utils-0.0.1.tar.gz
Algorithm Hash digest
SHA256 95199cc5a702f3b2919b4ca87f5df5bfcd908b62eeee12d4199482dcfe83c25a
MD5 16e4d55db35048c2d536a267b6873272
BLAKE2b-256 21e2d604642151f252d8a4261c00279a0ccad4bdd14dbe75fb46e2d6ad26ae2b

See more details on using hashes here.

File details

Details for the file selenium_proxy_utils-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for selenium_proxy_utils-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a0483665601315318c9eca161472befd56b548df10c4aa090a3d063836a07113
MD5 72dde448d538aef17490b87605c9b8fb
BLAKE2b-256 eb54c588a64342bb4e8d6f1eb989839d25d8c286d5dfe97418f573b2d487b2ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page