In the comment, you pointed out that it is driver.switch_to.frame (iframe). I haven't used Selenium recently and haven't confirmed it properly, but please refer to the comments you received as appropriate.
Note. Original story.
In Selenium, I take out a specific DOM element through the driver instance and click a button, but the DOM in the iframe is inaccessible as it is.
If you search for the DOM of the iframe first and call switch_to_frame
of the driver, you can tamper with the DOM of that iframe.
iframe = driver.find_element_by_css_selector('.some-selector')
driver.switch_to_frame(iframe)
driver.find_element_by_css_selector('.some-selector-in-iframe').click()
Recommended Posts