Selenious
.. image:: https://img.shields.io/pypi/v/selenious.svg :target: https://pypi.python.org/pypi/selenious
.. image:: https://img.shields.io/pypi/dm/selenious.svg :target: https://pypi.python.org/pypi/selenious
.. image:: https://github.com/bonafideduck/selenious/workflows/Sanity/badge.svg :target: https://github.com/bonafideduck/selenious/actions?query=branch%3Amaster+workflow%3A%22Sanity%22
.. image:: https://readthedocs.org/projects/selenious/badge/?version=latest :target: https://selenious.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
Library that allows deep extraction of layered data structures (like JSON).
- Free software: BSD license
- Documentation: https://selenious.readthedocs.io.
Introduction
Selenious enhances Selenium WebDriver find_element* functions to have a
timeout, debounce, poll_frequency, recover, and for find_elements*,
a min count.
Selenium already has an implicitly_wait and a WebDriverWait function.
Neither of these have the versatility and natural feel that Selenious add
to the code. To add a 5 second timeout to a single call, Selenious would
be:
driver.find_element_by_id('popup', timeout=5)
While with implicitly_wait the code would be
driver.implicitly_wait(5)
driver.find_element_by_id('popup')
driver.implicitly_wait(hopefully_you_know_what_the_setting_was_before)
And WebDriverWait would be
WebDriverWait(driver, 5).until(
EC.presence_of_element_located((By.ID, "popup"))
)
Features
Enhancement to the find_element function
-
timeout- The maximum time in seconds to wait for a succesful find. -
poll_frequency- How often to poll the driver for the element -
debounce- Forfind_elements*wait for this time period for the count to not change. -
min- Forfind_elements*the minimum count to find. -
recover- If the item or min items are not found, call this periodically and try again.
Drop-in replacement for selenium webdriver
Instead of from selenium.webdriver import Chrome a convenience
of from selenious.webdriver import Chrome can be used that
imports the SeleniousMixin for you.
Settings can be set in the function or globally
Locally, webdriver.find_element_by_id('id', timeout=5), or globaly,
webdriver.timeout = 5.
Credits
This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _audreyr/cookiecutter-pypackage: https://github.com/audreyr/cookiecutter-pypackage
History
0.1.0 (2020-10-11)
- First release on PyPI.
Metadata
Release files for selenious 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| selenious-0.1.0.tar.gz | 11.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| selenious-0.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 24.4 kB
Release files / selenious-0.1.0.tar.gz
| Download URL | selenious-0.1.0.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4851523237deb979ded10b43c7c61485157e6689a5ff6d1af24e501c6485bae7
|
|
BLAKE2b-256 checksum How to use checksums |
9f750392e5c940462f55670202e0fbcb44d5814afd56902b6b580b5b7cc1a081
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
|
Release files / selenious-0.1.0-py2.py3-none-any.whl
| Download URL | selenious-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e7094a378dc9897fe30d67ad61f088c4cd31b756504941fa3d61dc8ffa49fbb2
|
|
BLAKE2b-256 checksum How to use checksums |
26b0e3721ef1ce2a49308bdf58335438f753533caaded40693f0fc6dbb103176
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
|