1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
Source: arsenic
Section: python
Priority: optional
Maintainer: Gianfranco Costamagna <locutusofborg@debian.org>
Build-Depends: debhelper-compat (= 13), dh-python,
python3-all,
python3-aiohttp,
python3-attr,
python3-structlog,
python3-setuptools
Standards-Version: 4.6.2
Homepage: https://github.com/HDE/arsenic
Package: python3-arsenic
Architecture: all
Depends: ${misc:Depends}, ${python3:Depends},
Recommends: ${python3:Recommends}
Suggests: ${python3:Suggests}
Description: Asynchronous WebDriver client
Asynchronous webdriver client built on asyncio.
.
Let's run a local Firefox instance.
.
from arsenic import get_session
from arsenic.browsers import Firefox
from arsenic.services import Geckodriver
.
.
async def example():
# Runs geckodriver and starts a firefox session
async with get_session(Geckodriver(), Firefox()) as session:
# go to example.com
await session.get('http://example.com')
# wait up to 5 seconds to get the h1 element from the page
h1 = await session.wait_for_element(5, 'h1')
# print the text of the h1 element
print(await h1.get_text())
.
Alternatively also other drivers can be run, e.g.
Chromedriver or MSEdgeDriver
|