selenium python beralih ke iframe
# go to iframe
driver.switch_to.frame(iframe)
# back to previous frame
driver.switch_to.parent_frame()
marcofaga
# go to iframe
driver.switch_to.frame(iframe)
# back to previous frame
driver.switch_to.parent_frame()
self.driver = webdriver.Firefox()
## Give time for iframe to load ##
time.sleep(3)
## You have to switch to the iframe like so: ##
driver.switch_to.frame(driver.find_element_by_tag_name("iframe"))
## Insert text via xpath ##
elem = driver.find_element_by_xpath("/html/body/p")
elem.send_keys("Lorem Ipsum")
## Switch back to the "default content" (that is, out of the iframes) ##
driver.switch_to.default_content()