Metadata-Version: 2.1
Name: seleniumuser
Version: 1.0.3
Summary: Selenium wrapper to streamline usage.
Project-URL: Homepage, https://github.com/matt-manes/seleniumuser
Project-URL: Documentation, https://github.com/matt-manes/seleniumuser/tree/main/docs
Project-URL: Source code, https://github.com/matt-manes/seleniumuser/tree/main/src/seleniumuser
Author: Matt Manes
License-File: LICENSE.txt
Keywords: automation,selenium,webscraping
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: bs4~=0.0.1
Requires-Dist: noiftimer~=1.0.1
Requires-Dist: pytest~=7.2.1
Requires-Dist: selenium~=4.5.0
Requires-Dist: voxscribe~=1.0.0
Requires-Dist: whosyouragent~=1.0.3
Description-Content-Type: text/markdown

# seleniumuser
A module that sits ontop of Selenium to streamline scraping and automation workflows.<br>
Install with:
<pre>pip install seleniumuser</pre>
Currently supports using firefox or chrome.<br>
You will need to have the appropriate web driver executable for the browser and your system in either the system PATH or a location passed to the User class constructor.<br>
Firefox: https://github.com/mozilla/geckodriver/releases<br>
Chrome: https://chromedriver.chromium.org/downloads<br>

Basic usage submitting a generic form with fields for first name, last name, email address, and phone number:
<pre>
from seleniumuser import User
user = User(browser_type="firefox")
user.get('https://somewebsite.com')
user.send_keys('//input[@id="first-name"]', 'Bill')
user.fill_next(['Billson', 'bill@bill.com', '5345548486'])
user.click('//button[@id="submit"]')
try:
    user.wait_until(lambda: 'Submission Received' in user.text('//p[@id="confirmation-message"]'))
    print('Submission success.')
except TimeoutError:
    print('Submission failed.')
user.close_browser()
</pre>
The User class supports being used with a context manager if you'd rather not worry about closing the browser before exiting the script:
<pre>
from seleniumUser import User
with User(browser_type="firefox") as user:
    user.get('https://somewebsite.com')
    user.send_keys('//input[@id="first-name"]', 'Bill')
    user.fill_next(['Billson', 'bill@bill.com', '5345548486'])
    user.click('//button[@id="submit"]')
    try:
        user.wait_until(lambda: 'Submission Received' in user.text('//p[@id="confirmation-message"]'))
        print('Submission success.')
    except TimeoutError:
        print('Submission failed.')
</pre>
