I am trying to get to the iframe on this page: https://www.google.com/recaptcha/api2/demo. this is the iframe with images that you have to click. iframe shows up then you click on the "i'm not a robot" button. you have to use selenium for this to work, it won't work if you do it manually in chrome.
code:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://www.google.com/recaptcha/api2/demo')
iframe = driver.find_element_by_xpath('//*[@id="recaptcha-demo"]/div/div/iframe')
driver.switch_to.frame(iframe)
driver.find_element_by_class_name('recaptcha-checkbox').click()
#choose new iframe with pictures - doesn't work
iframe = driver.find_element_by_xpath('/html/body/div[2]/div[4]/iframe')
what is the problem here? tnx, vasja