简体   繁体   English

未为 selenium 定义名称驱动程序

[英]Name driver is not defined for selenium

this is the error which i have got when executed the code这是我在执行代码时遇到的错误

and the code is代码是

import selenium
from selenium import webdriver
webdriver.Firefox()
driver.get("http://google.com")

You have to define the variable driver before using it.您必须在使用它之前定义变量驱动程序。 It should look something like this:它应该看起来像这样:

from selenium import webdriver
driver = webdriver.Firefox(path_to_driver_dir)
driver.get("http://google.com")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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