【Python+selenium Wendriver API】之鼠标悬停事件
# encoding=utf-8
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains browser = webdriver.Chrome('E:\\chromedriver.exe')
browser.maximize_window()
browser.get('http://www.uestc.edu.cn/')
# 方法一:使用find_element_by_link_text找到顶级菜单,并将鼠标移动到上面
article = browser.find_element_by_link_text(u'学校概况')
ActionChains(browser).move_to_element(article).perform()
# 方法二:使用find_element_by_xpath找到顶级菜单,并将鼠标移动到上面
# article = browser.find_element_by_xpath('//a[contains(@href,"?ch/3")]')
# ActionChains(browser).move_to_element(article).perform()
# 方法一:使用find_element_by_link_text找到二级菜单,并点击
# menu = browser.find_element_by_link_text(u'学校简介')
# 方法二:使用find_element_by_xpath找到二级菜单,并点击
menu = browser.find_element_by_xpath('//li[@classes="first odd nth1"]')
menu.click()
【Python+selenium Wendriver API】之鼠标悬停事件的更多相关文章
- 【Python+selenium Wendriver API】之操作警告和弹出框
参考文章: <Python+Selenium笔记(九):操作警告和弹出框>
- 【Python+selenium Wendriver API】之下拉框定位
上代码: # coding:utf-8 from selenium import webdriver from selenium.webdriver.common.action_chains impo ...
- WEB自动化(Python+selenium)的API
在做Web自动化过程中,汇总了Python+selenium的API相关方法,给公司里的同事做了第二次培训,分享给大家 ...
- seleium 鼠标悬停事件
seleium 教程:https://www.yiibai.com/selenium seleium官网:https://www.seleniumhq.org/docs/ 1.鼠标悬停 例如,下图 鼠 ...
- Python+Selenium WebDriver API:浏览器及元素的常用函数及变量整理总结
由于网页自动化要操作浏览器以及浏览器页面元素,这里笔者就将浏览器及页面元素常用的函数及变量整理总结一下,以供读者在编写网页自动化测试时查阅. from selenium import webdrive ...
- vue鼠标悬停事件
v-bind:title="message" <!DOCTYPE html> <html lang="en"> <head> ...
- Python+selenium之键盘和鼠标事件
- 使用python监听、模拟鼠标键盘事件
最近守望职业选手疑似开挂事件挺热闹的,在下小菜一枚,并不能从视频中看出端倪.看了一些关于外挂的讨论,自动点射和压枪只需在鼠标驱动上做些改动即可,自瞄或其他高级功能则需要读内存或修改游戏文件,检测也更容 ...
- 查看python selenium的api
打开命令行工具,doc中输入: python -m pydoc -p 然后在浏览器中访问http://localhost:4567/,此时应该可以看到python中所有的Modules 按ctrl+f ...
随机推荐
- 集合框架(06)Arrays
Arrays Arrays:用于操作数组的工具类,里面都是静态方法 ---数组变集合 1.asList:将数组变成List集合 把数组变成list集合的好处?可以使用集合的思想和方法来操作数组中的元素 ...
- IntelliJ IDEA控制台Console里没有查找快捷键
问题描述:之前的项目一直用的 Eclipse,习惯了其快捷键的使用,现在的项目换到IntelliJ IDEA,为了尽快上手,就把快捷键Keymap修改为Eclipse方式.发现在控制台Console里 ...
- uprobes issue with oracle 12c
https://mahmoudhatem.wordpress.com/2017/03/21/uprobes-issue-with-oracle-12c/
- App Distribution Guide (一)
This guide contains everything you need to know to distribute an app through the App Store or Mac Ap ...
- Sync 攻击原理及防范技术
据统计,在所有黑客攻击事件中,SYN攻击是最常见又最容易被利用的一种攻击手法.相信很多人还记得2000年YAHOO网站遭受的攻击事例,当时黑客利用的就是简单而有效的SYN攻击,有些网络蠕虫病毒配合SY ...
- applicationContext.xml文件如何调用外部properties等配置文件
只需要在applicationContext.xml文件中添加一行: <!-- 导入外部的properties文件 --> <context:property-placeholder ...
- 【Zookeeper】Zookeeper部署笔记
Zookeeper部署笔记 .上传zk安装包 .解压 .配置(先在一台节点上配置) .1添加一个zoo.cfg配置文件 $ZOOKEEPER/conf mv zoo_sample.cfg zoo.cf ...
- 2017.9.15 postgres使用postgres_fdw实现跨库查询
postgres_fdw的使用参考来自:https://my.oschina.net/Kenyon/blog/214953 postgres跨库查询可以通过dblink或者postgres_fdw来完 ...
- [阿里Hao]Android无线开发的几种经常使用技术
本文由阿里巴巴移动安全client.YunOS资深project师Hao(嵌入式企鹅圈原创团队成员)撰写,是Hao在嵌入式企鹅圈发表的第一篇原创文章.对Android无线开发的几种经常使用技术进行综述 ...
- javascript - 封装jsonp
jsonp牵扯到同源策略.跨域等问题,这里不细说了. 实现就是创建动态的script标签来请求后台地址: 示例: jsonp('xxx.php', { uid: 1 }, function (res) ...