webdriver-selector
webdriver_selector is a module designed to make headless selenium testing with python easier. If you are on a system and just want the first available webdriver preconfigured with a random useragent and set in headless mode, or if you want to run a known prespecified webdriver for a given browser, this module can do that.
Installation:
pip3 install webdriver-selector
Usage
the selector class can be called with two arguments:
chosendriver: the preferred webdriver, default to randomDriver
force: if a randomDriver is preferred, it will force checking every available driver until it either exhausts all available browsers and returns None or returns a viable driver.
Attributes:
chosendriver -- the chosen driver
force -- whether or not to force getting a random driver
driver -- the selenium webdriver data selected, defaults to None
availablefunctions -- the list of tuples of available function names and their functions
finalfunctionstring -- a human readable string of available functions to choose from
headless -- Bool of either True or False which specifies if you'd like the browser to be headless or not, defaults to True
incognito -- Bool which specifies if you'd like to run the browser in incognito or private browsing mode, default True
random_useragent -- Bool which specifies if you'd like to run the browser with a randomized useragent or keep the one for the selected browser, default True
EXPERIMENTAL
proxy_ip -- string of the ip address which you would want your browser to work through
proxy_port -- string of the port of the proxy you'd like to use. REQUIRED IF PROXY_IP IS SPECIFIED
Note this currently supports only HTTPS, unauthenticated proxies, and only seems to consistently work with Chrome based browsers. Examples:
##Getting the first available selenium webdriver on the system:
import webdriver_selector
driver=webdriver_selector.selector().driver
##selecting a particular webdriver:
import webdriver_selector
driver=webdriver_selector.selector(chosendriver="chrome").driver
Once you have a driver, it is simply now the selenium webdriver, with useage and documentation found here:
Release files for webdriver-selector 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| webdriver-selector-1.1.3.tar.gz | 18.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| webdriver_selector-1.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.6 kB
Release files / webdriver-selector-1.1.3.tar.gz
| Download URL | webdriver-selector-1.1.3.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d30d0200723f8cdbb8b98ce8c9e589ac74f5a39094c704d4f8abdc73b6dff40
|
|
BLAKE2b-256 checksum How to use checksums |
8e67c5ecae2fb413fc99d24b4af6558a7fba88768f6e1443482bea025235b49a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / webdriver_selector-1.1.3-py3-none-any.whl
| Download URL | webdriver_selector-1.1.3-py3-none-any.whl |
|---|---|
| Size | 17.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f90d9c291d84cb57986617ae272aa340f16b0102a8180dea20cfc86c5a58f90
|
|
BLAKE2b-256 checksum How to use checksums |
72df339e609cfaa8cee7d4adb700bd958d0aebc821f65fe1b2165689591524ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|