from selenium import webdriver
from time import sleep
'''
frame的操作:
1、通过id来切
2、通过name来切
3、通过index来切
4、定位元素来切
'''
driver = webdriver.Chrome()
driver.get('E:\\XueXi\\ZDH\\DaiMa\\DaiMa\\CZBK\\two\\myhtml4-3.html')
driver.implicitly_wait(20)
# driver.switch_to.frame('frame1')
# driver.switch_to.frame('myframe')
# driver.switch_to.frame(0)
ele = driver.find_element_by_id('frame1')
driver.switch_to.frame(ele)
driver.find_element_by_id('kw').send_keys('strom')
sleep(3)
driver.quit()