def login():
browser.get(url)
time.sleep(3)
browser.switch_to.frame(browser.find_element_by_tag_name("iframe"))
login_ele = browser.find_element_by_css_selector("li.account-tab-account.on")
login_ele.click()
加上了switch_to.frame, 还是报错。
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {“method”:“css selector”,“selector”:“li.account-tab-account.on”}