from selenium import webdriver
from time import sleep

driver=webdriver.Firefox()
file_path=r'E:\Destination Folder\pycharm\Test\Find_element\frame.html'
driver.get(file_path)

#切换frame嵌套页面
driver.switch_to.frame("search")

#页面元素的定位
driver.find_element_by_css_selector(".sec-input").send_keys("python")
driver.find_element_by_css_selector("#stb").click()

sleep(2)
driver.quit()
249cff556d78f7c042b1ea8f854b3a9526721bc4
<mask token>

<mask token>
driver.get(file_path)
driver.switch_to.frame('search')
driver.find_element_by_css_selector('.sec-input').send_keys('python')
driver.find_element_by_css_selector('#stb').click()
sleep(2)
driver.quit()

<mask token>
driver = webdriver.Firefox()
file_path = 'E:\\Destination Folder\\pycharm\\Test\\Find_element\\frame.html'
driver.get(file_path)
driver.switch_to.frame('search')
driver.find_element_by_css_selector('.sec-input').send_keys('python')
driver.find_element_by_css_selector('#stb').click()
sleep(2)
driver.quit()

from selenium import webdriver
from time import sleep
driver = webdriver.Firefox()
file_path = 'E:\\Destination Folder\\pycharm\\Test\\Find_element\\frame.html'
driver.get(file_path)
driver.switch_to.frame('search')
driver.find_element_by_css_selector('.sec-input').send_keys('python')
driver.find_element_by_css_selector('#stb').click()
sleep(2)
driver.quit()

from selenium import webdriver
from time import sleep

driver=webdriver.Firefox()
file_path=r'E:\Destination Folder\pycharm\Test\Find_element\frame.html'
driver.get(file_path)

#切换frame嵌套页面
driver.switch_to.frame("search")

#页面元素的定位
driver.find_element_by_css_selector(".sec-input").send_keys("python")
driver.find_element_by_css_selector("#stb").click()

sleep(2)
driver.quit()