selenium positioning is currently in the iframe (frame) in

Problem: When operating an element, positioning is not always on, this time in which you need to make sure the iframe.

FIG html code, there are many iframe, the following code

 

Orientation code:

Get the current iframe tag name to determine a few iframe, the relationship between the elements and you get to the page where the iframe, the iframe to switch.

for child_frame in driver.find_elements_by_tag_name("iframe"):
    child_frame_id = child_frame.get_attribute("src")
    print(child_frame_id)

  

 

Guess you like

Origin www.cnblogs.com/bubutianshu/p/11691186.html