Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    Nice answer. As OP is a new user, I just wanted to make the explanation as clear as possible. Commented Mar 16, 2019 at 18:18
  • I am facing the same issue I want to access an element but i think it is nested within iframe. <iframe scrolling="yes" src="goinet.in/gonoshow/default.aspx" style="border: 0px none; margin-left:10px;min-height: 700px; margin-top: 0px; width: 926px;">. I wanted to know how do I switch to this iframe. browser.switch_to.frame(browser.find_element(<what to put here>). As this iframe does not have id or name Commented Sep 6, 2023 at 12:09
  • I figured out how to switch the iframe, here is the code if anyone is looking for. iframe = browser.find_element(By.XPATH, "//iframe") browser.switch_to.frame(iframe) pnr = browser.find_element(By.ID, 'ContentPlaceHolder1_txt_PNR') Commented Sep 6, 2023 at 12:42