1

So what I want is to detect the visibility of an iframe which is h captcha and so far I can detect the element through find element but when try to do it through EC visibility it isn't able to detect it is there a particular way to detect it? My main purpose is to detect the visibility and invisibility of that particular iframe

submit_button = wait.until(
        EC.visibility_of_element_located((By.CSS_SELECTOR, 'button[data-testid="btn-signup-submit"]')))
    driver.execute_script("arguments[0].scrollIntoView();", submit_button)
    submit_button.click()
    wait = WebDriverWait(driver, 30)
    iframe_locator = (By.TAG_NAME, 'iframe')
    iframe = wait.until(EC.presence_of_element_located(iframe_locator))

    # Switch to the iframe
    driver.switch_to.frame(iframe)
print('captcha frame visible')

It doesn't wait for the frame but it checks the presence so what I think is the element is already available in the dom but is invisible I am having no luck I tried alot of things through x-path and stuff but unsuccessful

0

Browse other questions tagged or ask your own question.