Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97804

Selenium - Switch to dynamic iframe after onclick button

$
0
0

I am trying to switch into a new frame, which opens after clicking a button. Unfortunately, I receive a None value.

driver = webdriver.Firefox()

driver.get('https://www.milanuncios.com/dacia-de-segunda-mano/dacia-sandero-1-5-dci-exportacion-323650137.htm')
time.sleep(5)

driver.find_element_by_xpath('//button[@id="pagAnuShowContactForm"]').click()
time.sleep(5)

Till here, it works to open the contact information. Here, I would like to perform actions in the new, opened window. I tried the following options:

1.

contact = driver.switch_to.frame(driver.find_element_by_tag_name("iframe"))

2.

contact = driver.find_element_by_xpath('//div[@class="telefonos"]')

Viewing all articles
Browse latest Browse all 97804

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>