[selenium]元素在 iframe 中,无法点击

 

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)

 

posted @ 2023-06-20 17:00  *飞飞*  阅读(37)  评论(0)    收藏  举报