简体   繁体   中英

Unable to start chromedriver on linux 7 machine

I don't have display installed on my linux machine, my requirement is to crawl a webpage and get some information using selenium chrome webdriver . I have installed chrome and chromedriver on my linux 7 machine with version 2.33.506092 . Now when i try to run chromedriver binary , it hangs for some time showing below

Starting ChromeDriver 2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4) on port 9515 Only local connections are allowed.

and then outputs some errors. Below is the output:

Starting ChromeDriver 2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4) on port 9515

Only local connections are allowed.

[338.651][INFO]: COMMAND InitSession {
   "desiredCapabilities": {
      "browser": "chrome"
   }
}
[338.656][INFO]: Populating Preferences file: {
   "alternate_error_pages": {
      "enabled": false
   },
   "autofill": {
      "enabled": false
   },
   "browser": {
      "check_default_browser": false
   },
   "distribution": {
      "import_bookmarks": false,
      "import_history": false,
      "import_search_engine": false,
      "make_chrome_default_for_user": false,
      "show_welcome_page": false,
      "skip_first_run_ui": true
   },
   "dns_prefetching": {
      "enabled": false
   },
   "profile": {
      "content_settings": {
         "pattern_pairs": {
            "https://*,*": {
               "media-stream": {
                  "audio": "Default",
                  "video": "Default"
               }
            }
         }
      },
      "default_content_setting_values": {
         "geolocation": 1
      },
      "default_content_settings": {
         "geolocation": 1,
         "mouselock": 1,
         "notifications": 1,
         "popups": 1,
         "ppapi-broker": 1
      },
      "password_manager_enabled": false
   },
   "safebrowsing": {
      "enabled": false
   },
   "search": {
      "suggest_enabled": false
   },
   "translate": {
      "enabled": false
   }
}
[338.656][INFO]: Populating Local State file: {
   "background_mode": {
      "enabled": false
   },
   "ssl": {
      "rev_checking": {
         "enabled": false
      }
   }
}
[338.660][INFO]: Launching chrome: /opt/google/chrome --disable-background-networking --disable-browser-side-navigation --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-automation --enable-logging --force-fieldtrials=SiteIsolationExtensions/Control --ignore-certificate-errors --load-extension=/tmp/.org.chromium.Chromium.NEhqW7/internal --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12116 --safebrowsing-disable-auto-update --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.org.chromium.Chromium.6knWEC data:,
[338.661][DEBUG]: DevTools request: http://localhost:12116/json/version
LaunchProcess: failed to execvp:
/opt/google/chrome
[338.876][DEBUG]: DevTools request failed
[338.926][DEBUG]: DevTools request: http://localhost:12116/json/version
[338.927][DEBUG]: DevTools request failed
[338.977][DEBUG]: DevTools request: http://localhost:12116/json/version
[338.977][DEBUG]: DevTools request failed
[339.027][DEBUG]: DevTools request: http://localhost:12116/json/version
[339.028][DEBUG]: DevTools request failed
[339.078][DEBUG]: DevTools request: http://localhost:12116/json/version
[339.078][DEBUG]: DevTools request failed
[339.129][DEBUG]: DevTools request: http://localhost:12116/json/version
[339.129][DEBUG]: DevTools request failed
[339.179][DEBUG]: DevTools request: http://localhost:12116/json/version

I had the same error and it was due to incompatible versions of chrome and chromedriver. I got it to work with this combination.

ChromeDriver 2.36.540471 Google Chrome 66.0.3359.139

This is a bit late for the OP but might help someone else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM