Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coskundeniz/webdriver-setup
Easy to use webdriver instance creation api
https://github.com/coskundeniz/webdriver-setup
browser-automation python selenium-webdriver webdriver
Last synced: about 1 month ago
JSON representation
Easy to use webdriver instance creation api
- Host: GitHub
- URL: https://github.com/coskundeniz/webdriver-setup
- Owner: coskundeniz
- License: apache-2.0
- Created: 2020-11-15T16:39:56.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-29T12:33:37.000Z (almost 3 years ago)
- Last Synced: 2024-08-10T11:28:45.390Z (3 months ago)
- Topics: browser-automation, python, selenium-webdriver, webdriver
- Language: Python
- Homepage: https://pypi.org/project/webdriver-setup/
- Size: 14.6 KB
- Stars: 2
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
webdriver-setup
===============
Easy to use webdriver instance creation api.This package prevents manually downloading and setup of the webdriver binaries
by automatically finding and installing the related webdriver binary, and
provides an easy to use instance creation api. It uses
[webdriver_manager](https://pypi.org/project/webdriver-manager/) package.### Supported browsers
* Firefox
* Chrome
* Opera
* Safari
* Ie
* Edge (Chromium based)## Installation
`pip install webdriver-setup`
## Usage
```python
from webdriver_setup import get_webdriver_for# create driver instance
driver = get_webdriver_for("firefox")# start the browser with the given url
driver.get("https://www.python.org/")# print the title of the website
print(f"Title: {driver.title}")# quit browser
driver.quit()
```You can also pass all the keyworded arguments as you would normally do with the Selenium webdriver instances.
```python
from webdriver_setup import get_webdriver_for
from selenium.webdriver import FirefoxOptionsfirefox_options = FirefoxOptions()
firefox_options.add_argument("--headless")driver = get_webdriver_for("firefox", options=firefox_options)
```### WDM Config
If you don't want to see *webdriver_manager* logs, set environment variable "WDM_LOG_LEVEL" to "0"
```python
import osos.environ["WDM_LOG_LEVEL"] = "0"
```If you don't pass the `cache_valid_range` option, it will be set to 7 days by default.
You can change it as follows```python
from webdriver_setup import get_webdriver_fordriver = get_webdriver_for("firefox", cache_valid_range=3)
```