asyncselenium Package
- This is a tools and libraries enabling web browser automation.
- it makes selenium to be async, and improve the performance!
- the useage is the same to selenium to make it easy to use.
you can simply install or upgrade:
pip install -U asyncselenium
if you already make the remote driver running (use the default port 4444):
.. code-block:: python
import asyncio
from selenium import webdriver
from selenium.webdriver.common.by import By
from asyncselenium.webdriver.remote.async_webdriver import AsyncWebdriver
from asyncselenium.webdriver.support.async_wait import AsyncWebDriverWait
from asyncselenium.webdriver.support import async_expected_conditions as ec
async def test_get():
chrome_options = webdriver.ChromeOptions()
browser = await AsyncWebdriver(options=chrome_options)
wait = AsyncWebDriverWait(browser, 20)
await browser.get('https://www.baidu.com')
ele = await wait.until(ec.presence_of_element_located((By.XPATH, '//*[@id="su"]')))
search = await wait.until(ec.presence_of_element_located((By.XPATH, '//*[@id="kw"]')))
await search.send_keys('python')
print(await ele.tag_name)
await asyncio.sleep(3)
await browser.quit()
asyncio.run(test_get())
.. code-block:: python
import asyncio
import sys
sys.path.append('.')
from selenium.webdriver.chrome import service
from asyncselenium.webdriver.chrome.async_webdriver import WebDriver
driver_path = ''
async def test_get():
browser = await WebDriver(driver_path)
await browser.get('https://www.baidu.com')
await asyncio.sleep(5)
await browser.quit()
async def test_multi_browser():
service = WebDriver.get_service(driver_path)
browser = await WebDriver(driver_path, service=service)
await browser.get('https://www.baidu.com')
browser2 = await WebDriver(driver_path, service=service)
await browser2.get('https://news.baidu.com')
await asyncio.sleep(5)
await browser.quit(stop_service=False)
await browser2.get('https://www.baidu.com')
await asyncio.sleep(5)
await browser2.quit()
asyncio.run(test_multi_browser())
Metadata
Release files for asyncselenium 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| asyncselenium-0.0.2.tar.gz | 24.7 kB | Without provenance | Details for asyncselenium-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asyncselenium-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for asyncselenium-0.0.2-py3-none-any.whl |
Total release size: 54.0 kB
Release files / asyncselenium-0.0.2.tar.gz
| Download URL | asyncselenium-0.0.2.tar.gz |
|---|---|
| Size | 24.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af37f60fa618e408f6db658002f6276d4810beca31fb8b381e0e729b6c6851b0
|
|
BLAKE2b-256 checksum How to use checksums |
066ead5359f256291427dad4cfdaf642e126fa80fece900dbd1a3e2ad304b966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
|
Release files / asyncselenium-0.0.2-py3-none-any.whl
| Download URL | asyncselenium-0.0.2-py3-none-any.whl |
|---|---|
| Size | 29.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28ad21280151cff3b7680cbaf0e871a091b271d8e2e7f7d286223d9475b05d0b
|
|
BLAKE2b-256 checksum How to use checksums |
bde7fe9bd569d4efe76736e2bf892065d612a8237ce35aee71180d9315c96c8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
|
Security for asyncselenium 0.0.2
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.