python的frame切换
from selenium import webdriver driver = webdriver.Chrome() driver.get("https://www.***.cn") #有id的,用id定位,id=iframe1 driver.switch_to.frame("iframe1") #无id的,用index索引定位,index=1 driver.switch_to.frame(1) #切换回默认 driver.switch_to.default_content() driver.quit()