enter image description here

I switched to that iframe but still unable to reach in the elements under HTML. Please be aware #document has no a css selector or xpath, I think it is not an element. Thank you for your help in adcance.

1

There are 1 best solutions below

0
Shawn On

You can use By.ID locator strategy as below:

# To switch into the desired IFRAME
iframe = driver.find_element(By.ID, "remote_iframe_0")
WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it(iframe))

# perform desired actions here within the IFRAME

# To come out of iframe
driver.switch_to.default_content()

Imports required:

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC