A simple Selenium wrapper that makes browser automation easier. Inspired by Selene
from selenium.webdriver import Chrome
from yet_another_selenium_wrapper.browser import Browser, Config
from yet_another_selenium_wrapper.match import match
browser = Browser(Chrome(), Config(base_url='https://example.com'))
browser.open('/')
browser.elements('h1').should(match.size(1))
paragraphs = browser.elements('body p')
paragraphs.should(match.size(2))
paragraphs.first.should(
match.text(
'This domain is for use in documentation examples without needing permission. Avoid use in operations.'
)
)
paragraphs[2].should(match.text('Learn more'))
browser.element('body a').click()
browser.element('h1').should(match.text('Example Domains'))- Clone and setup virtual environment:
git clone https://github.com/atrskv/yet-another-selenium-wrapper.git
cd yet-another-selenium-wrapper
uv venv --python 3.12
source .venv/bin/activate
- Install package in development mode:
uv pip install -e .
- Install dependencies:
uv sync