0

Im trying to click on audio button on a reCaptcha popup(see my photo) but i cannot, this is my code : enter image description here

self.driver.switch_to.default_content()
all_frames = self.driver.find_elements_by_tag_name('iframe')
self.driver.switch_to.frame(all_frames[0])
self.driver.find_element_by_id('recaptcha-audio-button').click()
0

1 Answer 1

0

I have solved my problem by this code :

self.driver.switch_to_frame(self.driver.find_element_by_tag_name("iframe"))
self.driver.switch_to.default_content()
frames = self.driver.find_elements_by_tag_name("iframe")
self.driver.switch_to.frame(frames[-1])
self.driver.find_element(By.ID, 'recaptcha-audio-button').click()

   
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.