An error occurred while invoking the browser with Webdriver
Tips:
Raise Webdriverexception ("Can not connect to the Service%s"% Self.path)
Selenium.common.exceptions.WebDriverException:Message:Can not connect to the Service chromedriver
The general meaning is that the link is not available and the path cannot be found
Workaround:
One, with Baidu check, and did not find similar problems, followed by Google has found the same problem, but unfortunately no one to give answers
Second, try to start from path, found all normal
It's starting to get a little panicked.
Third, view the Hosts file configuration
Cat/etc/hosts
# This is licensed under a CC BY-NC-SA 4.0 international License.
# https://creativecommons.org/licenses/by-nc-sa/4.0/
# Localhost (Do not REMOVE)
127.0.0.1tkpt450
:: 1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 Ip6-mcastprefix
Ff02::1 Ip6-allnodes
Ff02::2 ip6-allrouters
Try adding 127.0.0.1 localhost
Run the code again
#!/usr/bin/env python
#-*-Coding:utf-8-*-
From selenium import Webdriver
Firefox_driver = Webdriver. Firefox ()
Firefox_driver.get ("http://www.baidu.com")
Print Firefox_driver.title
Firefox_driver.quit ()
OK, the call succeeds.
Baidu a bit, you will know
[Finished in 5.3s]
Summary, previously modified the hosts to facilitate scientific access to the Internet, the 127.0.0.1 localhost deleted, but in fact, and eggs.
Webdriver failed to invoke browser