Skip to main content

Adapter for Selenium

Project description

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

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.

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

weberist-0.3.0.tar.gz (33.0 kB view details)

Uploaded Source

Built Distribution

weberist-0.3.0-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

Details for the file weberist-0.3.0.tar.gz.

File metadata

  • Download URL: weberist-0.3.0.tar.gz
  • Upload date:
  • Size: 33.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Linux/6.5.0-35-generic

File hashes

Hashes for weberist-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e6eb358f7665f6d532e84958e2d268a573a78728a376fd45f431116fdf7d1b67
MD5 5a079a770e87519587cffd20d8474d92
BLAKE2b-256 1ce2fea8443202c7aa38f7b294314adb2d6d4407db30b51ac58006c096e1c78a

See more details on using hashes here.

File details

Details for the file weberist-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: weberist-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Linux/6.5.0-35-generic

File hashes

Hashes for weberist-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07bee5662b451f8b672ed5228417d547a27608d399014bd0aee9904c90660f0d
MD5 ce4591925e55ac8586ace011607f34a9
BLAKE2b-256 1f68f2d5cf7a0c9237a700323c9a117b1691b55d620cf7916eafb63d5021f051

See more details on using hashes here.

Supported by

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