Skip to content
forked from HENNGE/arsenic

Async WebDriver implementation for asyncio and asyncio-compatible frameworks (backport to Python 3.5)

License

Notifications You must be signed in to change notification settings

konstunn/arsenic

 
 

Repository files navigation

Async Webdriver (Python 3.5 backport)

CircleCI Documentation Status BrowserStack Status Appveyor status PyPI version Code style: black License

Asynchronous webdriver client built on asyncio.

Backport to Python 3.5 is in develop branch as for now.

History of backport

I had a project written in Python 3.5, but wanted to use arsenic which requires Python 3.6+, so I had choice to migrate the infrastucture to Python 3.6 or to backport arsenic to Python 3.5.

The project was a piece of software for some kind of ATMs. There was 1000+ of ATMs so I've decided that so far then it was easier to backport arsenic from Python 3.6 to Python 3.5 rather than to migrate the infrastructure from Python 3.5 to Python 3.6.

Installation

pip install git+https://github.com/konstunn/arsenic@develop

Quickstart

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

For more information, check the documentation

CI Supported by Browserstack

Continuous integration for certain browsers is generously provided by Browserstack.

Browserstack

Packages

No packages published

Languages

  • Python 95.7%
  • HTML 4.3%