相关的包(有的人称为库)没有导入
from selenium.webdriver.common.by import By
from selenium import webdriver
chromedriver使用的话尽量配置一下,chromedriver和chrome配套使用,版本号尽量一致
find_element的使用格式好像不对,举例
driver.find_element(By.ID, 'foo')
更多参考https://www.cnblogs.com/qican/p/13131445.html
它举了一个例子
from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get('https://www.baidu.com')
driver.find_element(By.ID,'kw').send_keys('python')