当前位置:网站首页>Selenium mouse sliding operation event
Selenium mouse sliding operation event
2022-07-07 09:08:00 【Song_ Lun】
selenium Mouse operation events Slide the mouse over the control to display the drop-down data
ActionChains
import time
from selenium import webdriver
from selenium.webdriver import ActionChains
def xuanting():
""" Baidu mouse moves to display drop-down data :return: """
driver = webdriver.Chrome()
driver.get('https://www.baidu.com/')
driver.maximize_window()
hover_element = driver.find_element_by_css_selector('#s-top-left > div > a')
ActionChains(driver).move_to_element(hover_element).perform()
xuan = driver.find_element_by_css_selector(
'#s-top-more > div.s-top-more-content.row-2.clearfix > a:nth-child(4) > img')
time.sleep(10)
xuan.click()
driver.quit()
if __name__ == '__main__':
xuanting()
边栏推荐
猜你喜欢
Output all composite numbers between 6 and 1000
数字三角形模型 AcWing 1027. 方格取数
ESP32-ULP协处理器低功耗模式RTC GPIO中断唤醒
Nanjing commercial housing sales enabled electronic contracts, and Junzi sign assisted in the online signing and filing of housing transactions
Do you have any certificates with high gold content?
Unityshader introduction essentials personal summary -- Basic chapter (I)
C语言指针(中篇)
Why is access to the external network prohibited for internal services of the company?
C语言指针(下篇)
Digital triangle model acwing 1027 Grid access
随机推荐
Panel display technology: LCD and OLED
Do you have any certificates with high gold content?
Nanjing commercial housing sales enabled electronic contracts, and Junzi sign assisted in the online signing and filing of housing transactions
【ChaosBlade:节点磁盘填充、杀节点上指定进程、挂起节点上指定进程】
STM32的时钟系统
面试题:高速PCB一般布局、布线原则
2020 year end summary
What are the suggestions for PMP candidates?
Unity Shader入门精要初级篇(一)-- 基础光照笔记
Un salaire annuel de 50 W Ali P8 vous montrera comment passer du test
Reflections on the way of enterprise IT architecture transformation (Alibaba's China Taiwan strategic thought and architecture practice)
C语言指针(下篇)
Simulation volume leetcode [general] 1706 Where does the ball meet
PPT模板、素材下载网站(纯干货,建议收藏)
LeetCode 715. Range 模块
Original collection of hardware bear (updated on June 2022)
Simple use of Xray
External interrupt to realize key experiment
[chaosblade: node disk filling, killing the specified process on the node, suspending the specified process on the node]
5A summary: seven stages of PMP learning