0

When I am trying to run webdriver (chrome) I gets error "unknown error: Chrome failed to start: exited abnormally". I have this error only on linux, on my PC (windows) I don't have this error.

google-chrome version: 73.0.3683.86

chromedriver version: ChromeDriver 73.0.3683.68

Ubuntu version: 18.04

I have tried running Xvfb, and exporting screen.

Xvfb :0 -ac -screen 0 1024x768x24 &
export DISPLAY=:0

Chrome options:

    var chromeDesktop = {
                "browserName": "chrome",
                "javascriptEnabled": true,
                "acceptSslCerts": true,
                "chromeOptions": {
                    "args": [/*`--proxy-server=${proxyUrl}`,*/'user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"','--disable-web-security','--allow-running-insecure-content'],
                    "prefs": {
                        "profile.managed_default_content_settings.images": 2
                    },
                    "extensions": [
                         encode('./anti-captcha.crx')
                    ]
                }
            };

I can not run code in headless, beacuse I must load extension. What can I do?

Error screenshot

ksew
  • 61
  • 2
  • 10

1 Answers1

0

Not sure why the old post was deleted (being marked it as duplicate).

Please see these two links -

In your chromeOptions, add --no-sandbox and --disable-dev-shm-usage options along with the other args that you have put - like this

"args": [/*`--proxy-server=${proxyUrl}`,*/'user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"','--disable-web-security','--allow-running-insecure-content','--no-sandbox','--disable-dev-shm-usage'],
demouser123
  • 4,108
  • 9
  • 50
  • 82
  • I have tried adding these arguments, but it still does not work. I also tried lowering chromedriver version (which supports v73 chrome), but it does not work too. – ksew Mar 30 '19 at 17:42
  • Are you running headless chrome? – demouser123 Mar 30 '19 at 17:43
  • No, I can not run headless chrome, beacuse headless chrome doesn't support extesnions. – ksew Mar 30 '19 at 17:46