D
D
DAnya782021-11-15 22:26:58
Python
DAnya78, 2021-11-15 22:26:58

How to view inner frame?

there is a page on which a frame is loading and there is another one in it,
I need to click on an element of the second frame that is inside the first
6192b2682fdc2632946873.jpeg

driver.switch_to.frame(driver.find_element_by_tag_name('iframe'))
driver.switch_to.frame(driver.find_element_by_xpath('//iframe[@title="проверка recaptcha"]'))
driver.find_element_by_css_selector('#recaptcha-reload-button').click()

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"#recaptcha-reload-button"}
1. First frame
2. Second frame
3. I get the button that
6192b3416fb2e072567463.jpeg
I press only the first frame
, but for some reason, when I connect to the second frame, it doesn’t give an error, but it’s not there

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ab1, 2021-12-20
@ab1

This is shadow_dom (#document)
google how to get it, for example
https://stackoverflow.com/questions/23920167/acces...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question