python selenium cant find elements in iframe

To find elements within an iframe using selenium, you’ll need to use the driver’s switch_to.frame() method:

i_frame = driver.find_element_by_id("iframe_id")

Now you can locate elements as normal

Why does this happen?

Selenium initally looks for the first HTML tag available in the page. However, iframes have their very own second HTML tag, thus its necessary to switch back and forth when finding elements.  




  1. 1XBet
    Betting in India. It can be great to find the most popular brands, especially ones that offer betting on 1xbet korean sports such as football, tennis,  Rating: 1/10 · ‎Review by Riku VihreasaariWhere 토토 사이트 can I find 1xbet?Where can I find 1xbet betting?


Post a Comment

Popular posts from this blog

Append to a json file python

Setup Mailhog mail server on Ubuntu