报错原因
元素不可交互,可能未渲染出来
解决办法
方法1: 交互前等待一会
import time
time.sleep(5)
browser.find_element('id', 'submit').click()
方法2:
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
wait = WebDriverWait(browser, 30)
wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, 'input:nth-child(1)'))).click()
wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, 'ul li:nth-child(3)'))).click()