Unable to connect to Geckodriver

笑着哭i 提交于 2019-12-04 03:31:45

You have selenium-webdriver-3.0.0.beta3.1 which is only for Firefox 48 and later (and not yet properly working). Fallback to selenium-webdriver version 2.53.4 and try again.

As an addition to DarKy's solution with selenium version downgrade:

  • In the terminal change directory path to the directory where gem was installed
  • Run gem uninstall selenium-webdriver
  • Run gem install selenium-webdriver -v 2.53.4
Anil
  • ruby: ruby 2.3.3p222
  • selenium-webdriver: selenium-webdriver (3.7.0)
  • Firefox : V57

Selenium::WebDriver::Firefox.driver_path = "‪C:\\Users\\Desktop\\geckodriver.exe"
capabilities = Selenium::WebDriver::Remote::Capabilities.firefox(accept_insecure_certs: true)
driver = Selenium::WebDriver.for :firefox, desired_capabilities: capabilities
driver.navigate.to "https://google.com"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!