Skip to content Skip to sidebar Skip to footer

How To Navigate A Subframe Inside A Frameset Using Selenium Webdriver With Python?

The layout of the hmtl page is the following :

Solution 1:

SOMMAIRE frame is not located inside ENTETE frame (and, according to the HTML fragment - it is not inside of any frame actually). This means you don't need to switch to ENTETE first. Just switch directly to SOMMAIRE:

driver.switch_to_default_content()  # in case you were inside an iframe before
driver.switch_to.frame("SOMMAIRE")

Solution 2:

Try navigating to SOMMAIRE using XPATH

driver.switchTo().frame(driver.findElement(By.xpath("xpath_of_SOMMARIE")));

Solution 3:

User neha bedi seemed to be on the right track but the response needed editing: Try

driver.switch_to.frame(driver.find_element_by_xpath('xpath_of_SOMMARIE')) 

This worked for me.


Post a Comment for "How To Navigate A Subframe Inside A Frameset Using Selenium Webdriver With Python?"