Skip to content

Commit

Permalink
Merge pull request #13 from HDE/windows-docs
Browse files Browse the repository at this point in the history
document how to use arsenic on windows
  • Loading branch information
ojii committed Jul 15, 2017
2 parents 6258128 + 3d0557b commit e44a295
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions docs/howto/windows.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Arsenic on Windows
##################

While arsenic is not currently tested on Windows, it should work just fine, if
you follow the steps below.


Use ``ProactorEventLoop``
*************************

Unless you're using the :py:class:`arsenic.services.Remote` service, you have to
use the :py:class:`asyncio.ProactorEventLoop` event loop to run arsenic. See
the `Python documentation`_ for more information.


Explicitly specify binaries
***************************

On unix systems, local services will work out of the box. On Windows, you need
to explicitly pass the absolute path to the services binary to the service.

For example, if you installed ``geckodriver.exe`` to ``C:\geckodriver\geckodriver.exe``,
you have to instantiate your arsenic session like this::

from arsenic import get_session, services, browsers

async def example():
service = services.Geckodriver(
binary='C:\\geckodriver\\geckodriver.exe'
)
browser = browsers.Firefox()
async with get_session(service, browser) as session:
...


.. _Python documentation: https://docs.python.org/3/library/asyncio-eventloops.html#asyncio.ProactorEventLoop
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Welcome to arsenic's documentation!
:caption: How-to Guides

howto/pytest
howto/windows
howto/action_chains

.. toctree::
Expand Down

0 comments on commit e44a295

Please sign in to comment.