Skip to content

atrskv/yet-another-selenium-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple Selenium wrapper that makes browser automation easier. Inspired by Selene

Basic example

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'))

For development

  1. 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
  1. Install package in development mode:
uv pip install -e .
  1. Install dependencies:
uv sync

About

A selenium wrapper... yet another

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages