Skip to main content

ausrine

PyPI License

A lightweight Selenium wrapper for web automation.

ausrine is designed to simplify web automation tasks by wrapping Selenium's functionality into an intuitive and easy-to-use API. Whether you're scraping data, testing web applications, or automating repetitive browser tasks, ausrine provides a streamlined experience with minimal setup.

Installation

Install ausrine using pip:

pip install ausrine

ausrine uses selenium>=4.0.0 with Selenium Manager, which automatically manages WebDriver dependencies. No additional setup is required beyond installation.

Usage

ausrine simplifies web automation with Selenium by providing an intuitive WebAutomationDriver class. Below is an example of performing a Bing search:

from ausrine import WebAutomationDriver
from ausrine.chrome import setup_webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys

# Initialize Chrome WebDriver
driver = setup_webdriver()

# Create WebAutomationDriver instance
ausrine = WebAutomationDriver(driver)

# Navigate to Bing
ausrine.get("https://www.bing.com/?cc=jp")

# Find the search box, type "iphone", and press Enter
ausrine.send_keys(by=By.NAME, value="q", text="iphone")
ausrine.send_keys(by=By.NAME, value="q", text=Keys.ENTER)

# Quit the driver
ausrine.quit()

You can also execute a sequence of commands using execute:

sequences = [
    {"get": {"url": "https://www.bing.com/?cc=jp"}},
    {"send_keys": {"by": By.NAME, "value": "q", "text": "iphone"}},
    {"send_keys": {"by": By.NAME, "value": "q", "text": Keys.ENTER}},
]
ausrine = WebAutomationDriver(setup_webdriver())
ausrine.execute(sequences)
ausrine.quit()

For error handling, use try_execute:

sequences = [
    {"get": {"url": "https://www.bing.com/?cc=jp"}},
    {"send_keys": {"by": By.NAME, "value": "q", "text": "iphone"}},
    {"send_keys": {"by": By.NAME, "value": "q", "text": Keys.ENTER}},
]
ausrine = WebAutomationDriver(setup_webdriver())
error = ausrine.try_execute(sequences)
if error:
    print(f"An error occurred: {error}")
else:
    print("Execution completed successfully")
ausrine.quit()

Form submission example

Below is an example of submitting a login form:

from ausrine import WebAutomationDriver
from ausrine.chrome import setup_webdriver
from selenium.webdriver.common.by import By

# Initialize Chrome WebDriver
driver = setup_webdriver()

# Create WebAutomationDriver instance
ausrine = WebAutomationDriver(driver)

# Navigate to a login page
ausrine.get("https://example.com/login")

# Fill in username and password, then submit
ausrine.send_keys(by=By.ID, value="username", text="user")
ausrine.send_keys(by=By.ID, value="password", text="pass", password=True)
ausrine.submit(by=By.ID, value="login-btn")

# Quit the driver
ausrine.quit()

Features

  • Simple API: Intuitive methods like get, click, send_keys, and submit for common web tasks.
  • Sequence Execution: Chain multiple commands with execute or try_execute for robust automation.
  • Customizable WebDriver: Configure Chrome with options like headless mode or custom download directories via setup_webdriver.
  • Lightweight: Minimal dependencies (only Selenium) and a focused feature set.

Requirements

  • Python >= 3.10
  • Selenium >= 4.0.0, < 5.0.0

License

This project is licensed under the terms of the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please see the CONTRIBUTING.md file for details and submit issues or pull requests to the GitHub repository.

Metadata

Release files for ausrine 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ausrine 0.1.0
File Size Uploaded Provenance
ausrine-0.1.0.tar.gz 9.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ausrine 0.1.0
File Interpreter ABI Platform
ausrine-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.5 kB

Release files / ausrine-0.1.0.tar.gz

Download URL ausrine-0.1.0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
023defbbb814460f99d8618dab19c92d63b55334e0935924fb2352396db9c43c
BLAKE2b-256 checksum
How to use checksums
acb9ebd5a18168a83de887b5917206f02551182c773d27ff8a2c229a1d3a1aab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.11

Release files / ausrine-0.1.0-py3-none-any.whl

Download URL ausrine-0.1.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5fe6a025389496e20de8c089c188f772b3cca6ebff945a0d19d953da166e22e2
BLAKE2b-256 checksum
How to use checksums
f53abfc19307863313845674c09569a8062219d8e1462ae970e0a5d6d3445c58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.11

Security for ausrine 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page