HENNGE / arsenic

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

Google Chrome: DevToolsActivePort file doesn't exist #118

Open gavrilka opened 3 years ago

gavrilka commented 3 years ago

My system:

Ubuntu 20.04 (AWS) Python 3.8.5 ChromeDriver 88.0.4324.96 Google Chrome 88.0.4324.182 Error: unknown error: DevToolsActivePort file doesn't exist The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.

Code:

async def arsenic_scraper(url):
    service = services.Chromedriver()
    browser = browsers.Chrome()
    browser.capabilities = {"goog:chromeOptions": {"args": ["--no-sandbox", "--disable-dev-shm-usage"]}}
    async with get_session(service, browser) as session:
        await session.get(url)
gavrilka commented 3 years ago

Solved it with this:

browser.capabilities = {"goog:chromeOptions": {"args": ["--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}