/README.md

https://github.com/HDE/arsenic · Markdown · 43 lines · 28 code · 15 blank · 0 comment · 0 complexity · 26f1012e833c441662b269f8cc80dd77 MD5 · raw file

  1. # Async Webdriver
  2. [![CircleCI](https://circleci.com/gh/HDE/arsenic/tree/main.svg?style=svg)](https://circleci.com/gh/HDE/arsenic/tree/main) [![Documentation Status](https://readthedocs.org/projects/arsenic/badge/?version=latest)](http://arsenic.readthedocs.io/en/latest/?badge=latest)
  3. [![BrowserStack Status](https://automate.browserstack.com/badge.svg?badge_key=QmtNVHFnWWRFSEVUdTBZNWU5NGMraVorWVltazFqRk1VNWRydW5FRXU2dz0tLVhoTlFuK2tZUTJ1UGx0UmZaWjg4R1E9PQ==--35ef3d28fbf8ea24ee7fa2a435f9271fbaaf85d4)](https://automate.browserstack.com/public-build/QmtNVHFnWWRFSEVUdTBZNWU5NGMraVorWVltazFqRk1VNWRydW5FRXU2dz0tLVhoTlFuK2tZUTJ1UGx0UmZaWjg4R1E9PQ==--35ef3d28fbf8ea24ee7fa2a435f9271fbaaf85d4)
  4. [![Appveyor status](https://ci.appveyor.com/api/projects/status/8l0koom7h93y1f9q?svg=true)](https://ci.appveyor.com/project/ojii/arsenic)
  5. [![PyPI version](https://badge.fury.io/py/arsenic.svg)](https://badge.fury.io/py/arsenic)
  6. [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
  7. [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
  8. Asynchronous webdriver client built on asyncio.
  9. ## Quickstart
  10. Let's run a local Firefox instance.
  11. ```python
  12. from arsenic import get_session
  13. from arsenic.browsers import Firefox
  14. from arsenic.services import Geckodriver
  15. async def example():
  16. # Runs geckodriver and starts a firefox session
  17. async with get_session(Geckodriver(), Firefox()) as session:
  18. # go to example.com
  19. await session.get('http://example.com')
  20. # wait up to 5 seconds to get the h1 element from the page
  21. h1 = await session.wait_for_element(5, 'h1')
  22. # print the text of the h1 element
  23. print(await h1.get_text())
  24. ```
  25. For more information, check [the documentation](https://arsenic.readthedocs.io/)
  26. ## CI Supported by Browserstack
  27. Continuous integration for certain browsers is generously provided by [Browserstack](http://browserstack.com).
  28. [![Browserstack](./.circleci/browserstack-logo.png)](http://browserstack.com/)