就挺奇怪的,这个代码是一个课程中的代码,一模一样,复制来的,为什么到我的电脑就报错
然后我也在论坛找了一下这个错误有些说是代码运行速度比网页加载速度快,我在每行代码中间都沉睡1s还是没用,而且元素看过了没有过期这是代码**
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Chrome(executable_path=r'C:\chromedriver\bin\chromedriver.exe')
actions = ActionChains(driver)
usernameTag = driver.find_element_by_name("username")
passwordTag = driver.find_element_by_name("password")
submitBtn = driver.find_element_by_class_name("SignFlow-submitButton")
actions.move_to_element(usernameTag)
actions.send_keys_to_element(usernameTag,"18888888888")
actions.move_to_element(passwordTag)
actions.send_keys_to_element(passwordTag,"xxxxxx")
actions.move_to_element(submitBtn)
actions.click(submitBtn)
actions.perform()
**