Weberist
Weberist is a powerful web automation and scraping framework built on top of Selenium. It provides a flexible and easy-to-use interface for managing web drivers, handling browser profiles, and executing automated tasks in a variety of browsers, including Chrome and Firefox. This README will guide you through the installation, configuration, and usage of Weberist, including examples of how to use ChromeDriver and FirefoxDriver.
Table of Contents
Features
- Support for multiple browsers (Chrome, Firefox, etc.)
- Easy management of browser profiles and local storage
- Integration with Docker for running headless browser instances
- Customizable user agents and window sizes
- Robust error handling and logging
- Stealthiness: out of the box stealth chrome driver. It passes tests like:
Installation
To install Weberist, you can clone the repository and install the required dependencies using pip:
git clone https://github.com/yourusername/weberist.git
cd weberist
pip install -r requirements.txt
Or install via pip:
pip install weberist
Make sure you have Docker installed and running if you plan to use the Docker features.
Configuration
Weberist uses a configuration file located in the config.py module. You can customize various settings such as the root directory, data directory, and browser versions.
Usage
Using ChromeDriver
To use ChromeDriver, you can create an instance of ChromeDriver and perform various actions like navigating to a URL, clicking elements, and sending keys.
from weberist.drivers import ChromeDriver
with ChromeDriver() as driver:
driver.goto("https://example.com")
element = driver.select("some-element-id")
driver.click(element)
Using FirefoxDriver
Similarly, you can instantiate a Firefox driver using the BaseDriver class.
from weberist.drivers import BaseDriver
with BaseDriver(browser='firefox') as driver:
driver.goto("https://example.com")
element = driver.select("some-element-id")
driver.click(element)
Running Docker Tasks
Weberist allows you to run browser instances in Docker containers using Selenoid. You can use the run_selenoid_driver_task function to execute tasks in a Dockerized environment.
from weberist.docker import run_selenoid_driver_task
def my_driver_task(driver):
driver.goto("https://example.com")
# Perform more actions...
result = run_selenoid_driver_task(my_driver_task, dockercompose_name='docker-compose.yml')
Modules
Data Management
The data.py module provides classes for managing user agents, window sizes, and profile storage. You can customize the data used for your web automation tasks.
Driver Management
The drivers.py module contains the BaseDriver class and specific driver implementations like ChromeDriver. It handles the instantiation and management of web drivers.
Docker Management
The docker.py module provides functions for creating Docker images, managing Docker containers, and running browser instances in a Dockerized environment.
Contributing
We welcome contributions to Weberist! If you have suggestions, bug reports, or feature requests, please open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for weberist 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| weberist-0.3.1.tar.gz | 33.0 kB | Without provenance | Details for weberist-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| weberist-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for weberist-0.3.1-py3-none-any.whl |
Total release size: 72.6 kB
Release files / weberist-0.3.1.tar.gz
| Download URL | weberist-0.3.1.tar.gz |
|---|---|
| Size | 33.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70ca74bea5539b57c000a43947906adfecd87a1631911950589d288c4023181d
|
|
BLAKE2b-256 checksum How to use checksums |
f34057422b42e34d62aae16cfaa9ab13efa51148804017f11657a236e6f3fe77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Linux/6.5.0-35-generic
|
Release files / weberist-0.3.1-py3-none-any.whl
| Download URL | weberist-0.3.1-py3-none-any.whl |
|---|---|
| Size | 39.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f6663ae33b49a0c51a33dcf4b3ffba0b182a57ac7e7db4080b414ba166defc7
|
|
BLAKE2b-256 checksum How to use checksums |
74569c81f569a780e969d3d4c9d3dd7703ded2f40f3e01a03991f0d4d3229823
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Linux/6.5.0-35-generic
|
Security for weberist 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.