HENNGE / arsenic

Async WebDriver implementation for asyncio and asyncio-compatible frameworks
Other
349 stars 52 forks source link

Spawning Chrome/Edge browser in Windows from WSL2 #151

Open Et9797 opened 2 years ago

Et9797 commented 2 years ago

I would like to spawn Chrome/Edge browsers that are on Windows paths but from within wsl2 where I'm running arsenic. The reason is that spawning Chrome installed on wsl2 in an XLaunch server is laggy on my pc. However, I cannot seem to find how to provide the Windows chrome/edge browser exec paths to arsenic. For the drivers I managed to make it work, but it will not spawn the browser in Windows.

from arsenic.services import Chromedriver, MSEdgeDriver
from arsenic.browsers import Chrome, MicrosoftEdge

service = MSEdgeDriver(binary="/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedgedriver.exe")
browser = MicrosoftEdge(binary="/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe")

await start_session(service, browser)

When I run this the driver starts running successfully, however the browser is not started in Windows. Any help appreciated