from selenium import webdriver
from selenium.webdriver import ActionChains
driver = webdriver.Chrome()
driver.implicitly_wait(10)
driver.maximize_window()
driver.get("https://www.baidu.com/")
# 鼠标悬停(难点)
setting = driver.find_element_by_id("s-usersetting-top")
ActionChains(driver).move_to_element(setting).perform()
driver.find_element_by_link_text("高级搜索").click()
# driver.find_element_by_class_name("item").click()
# driver.find_element_by_id("adv_keyword").send_keys("恋爱")
# driver.find_element_by_class_name("c-input").send_keys("心理学")
# driver.find_element_by_xpath("//*[@id='advanced']/div/form/ul/li[1]/div[4]/input").send_keys("故事")
练习参考文章:https://blog.csdn.net/weixin_73348410/article/details/129073467?spm=1001.2014.3001.5506