driver.switch_to.frame(driver.find_element(By.CSS_SELECTOR,'iframe')) #跳转到iframe time.sleep(5) InputButton = driver.find_element(By.LINK_TEXT,'GO') #在iframe中定位到元素 driver.execute_script('arguments[0].click();',InputButton) #点击元素 time.sleep(5)
driver.switch_to.frame(driver.find_element(By.CSS_SELECTOR,'iframe')) #跳转到iframe time.sleep(5) InputButton = driver.find_element(By.LINK_TEXT,'GO') #在iframe中定位到元素 driver.execute_script('arguments[0].click();',InputButton) #点击元素 time.sleep(5)