# 操作输入框
'''
from selenium import webdriver
import time
driver_path = r'D:\python\geckodriver-v0.23.0-win64\geckodriver.exe'
driver = webdriver.Firefox(executable_path=driver_path)
driver.get("https://www.baidu.com/")
inputTag = driver.find_element_by_id('kw')
inputTag.send_keys('python')
time.sleep(2)
inputTag.clear() # 清除输入框
'''
# 操作checkbox(记住当前选项/记住密码)
from selenium import webdriver
driver_path = r'D:\python\geckodriver-v0.23.0-win64\geckodriver.exe'
driver = webdriver.Firefox(executable_path=driver_path)
driver.get("https://accounts.douban.com/passport/login_popup?login_source=anony")
remenberTag = driver.find_element_by_name("remember")
remenberTag.click()
# 操作select标签
"""
from selenium import webdriver
from selenium.webdriver.support.ui import Select
driver_path = r'D:\python\geckodriver-v0.23.0-win64\geckodriver.exe'
driver = webdriver.Firefox(executable_path=driver_path)
driver.get("https://www.52pojie.cn/")
"""
网友评论