Python+Selenium自动化测试之163框架切换
import time from selenium import webdriver driver = webdriver.Chrome() driver.get("https://email.163.com") time.sleep(2) iframe = driver.find_elements_by_tag_name("iframe")[0] driver.switch_to.frame(iframe) driver.find_element_by_name("email").send_keys("liujiale") time.sleep(1) driver.find_element_by_name("password").send_keys("666666") time.sleep(1) driver.find_element_by_id("dologin").click() driver.switch_to.default_content() # 退出框架
本文来自博客园,作者:{Tester十点半},转载请注明原文链接:https://www.cnblogs.com/jialeliu/p/13633555.html