Closed louissiu198 closed 4 months ago
I tried that, WebDriverWait(driver, 15).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH, '//[@id="hcaptchaContainer"]/iframe'))) WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '//[@id="checkbox"]'))).click() I need to target the Iframe in order to click the button. Drissionpage does not accept iframe console js. You can only run some specific js on the iframe console not the whole-page console
如果是异域iframe,先获取iframe元素,再使用这个元素在里面找button元素。如果是同域iframe,除了上面这种方法,还可以直接用定位符拿到里面的button元素进行操作。