geckodriver确实启动了Firefox,但Firefox没有获得url。请查看并指出我的函数有什么问题。我对selenium和python非常陌生,这对我会有很大的帮助
import selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
def Login(SiteUrl):
driver = webdriver.Firefox()
driver.get(SiteUrl)
if __name__ =="__main__":
url = "www.google.com"
Login(url)
这仅仅意味着要么你的lib是旧的,要么Gecko二进制是旧的。新的壁虎图书馆现在可用。你知道吗
下载地址:
https://github.com/mozilla/geckodriver/releases
从以下URL下载selenium python libs的新版本:
https://pypi.python.org/pypi/selenium
马丁指出的另一件事
在传递URL之前添加
http
或https
这样的协议所以使用URL作为:
可能有多种原因-
尝试在url中包含HTTP协议,即-http://www.google.com
你可能在代理服务器后面。看看这个问题->;Selenium WebDriver: Firefox starts, but does not open the URL&;Selenium WebDriver.get(url) does not open the URL
驱动程序和浏览器的版本不匹配。
相关问题 更多 >
编程相关推荐