-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from HDE/windows-docs
document how to use arsenic on windows
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters