iframe嵌套定位

from selenium import webdriver
driver=webdriver.Chrome()
file_path=r"D:\PychramProjects\lyttest\Test\Frame.html"
driver.get(file_path)
driver.switch_to.frame('search')#定位到iframe控件
driver.find_element_by_id('query').send_keys('selenium')
driver.find_element_by_id('stb').click()
sleep(3)
driver.quit()
posted @ 2018-11-21 11:07  Luafair  阅读(375)  评论(0编辑  收藏  举报