How to switch between iframes using Selenium and Python?
问题 I'm trying to make a script to checkout on a Shopify site and I was able to find the iframe for the card number, but was not able to find the iframe for the name on the card (2nd iframe). Is there any way to enter in a value for that iframe? driver.switch_to.frame(driver.find_element_by_tag_name("iframe")) driver.find_element_by_xpath('//input[@autocomplete="cc-number"]').send_keys("1234") driver.find_element_by_xpath('//div[@data-card-field-placeholder="Name on card"]').click() driver.switch