Considering that there is no function that works very well natively in Selenium for using proxys with authentication in chromedriver, this is an effective way to solve this problem.
Project description
Selenium Proxy Extension v0.1.1
Considering that there is no function that works very well natively in Selenium for using proxys with authentication in chromedriver, this is an effective way to solve this problem.
Installation
pip install seleniumproxy
Usage
First, we import the extension, using the following syntax:
from seleniumproxy import proxies
Then we can use the syntax to set the proxy
proxies_extension = proxies("username", "password", "host", "port")
It looks like this:
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.support.ui import WebDriverWait
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from seleniumproxy import proxies
def open_browser():
chrome_options = webdriver.ChromeOptions()
proxies_extension = proxies("username", "password", "host", "port")
chrome_options.add_extension(proxies_extension)
service = Service(executable_path='./chromedriver.exe')
driver = webdriver.Chrome(service=service, options=chrome_options)
driver.get("https://api.my-ip.io/v2/ip.json")
input("")
if __name__ == "__main__":
driver = open_browser()
How it works?
This extension works in a very simple way, when calling the proxies function, it creates a javascript extension that configures the proxy in the browser, and this extension is injected when starting the browser
Roadmap
- Add possibility to change the proxy with the browser open
- Support browsers other than Chromedriver
Author
- Github @kairodev
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file seleniumproxy-0.1.1.tar.gz.
File metadata
- Download URL: seleniumproxy-0.1.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71ce3e7e47453b4413194f7bb97485e82d7456b8de2302de51973b793fde7575
|
|
| MD5 |
7da69101ba1e9ace75661f6ff12bb121
|
|
| BLAKE2b-256 |
5f541c93b661296ba7ccdf8577a001151d3d2f945b2e7c2429d68a78cf0013ad
|
File details
Details for the file seleniumproxy-0.1.1-py3-none-any.whl.
File metadata
- Download URL: seleniumproxy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98c60a0ec3ab02358801105433b6e0c9776bc089d22ecde2e349d07383a8cbf8
|
|
| MD5 |
e768864f61f056935a968799628ab5db
|
|
| BLAKE2b-256 |
a9f236a5dd18c222270c771861789f72c823e570bd758172422b37c70f3d19be
|