selenium+python自动化中 读取文本属性值和读取文本值
2016-03-14 15:09
218 查看
<body> <span class="textbox" eid="cityUpdate" style="width: 278px; height: 22px;"> <input type="text" autocomplete="off" class="textbox-text validatebox-text" id="e-cityUpdate" placeholder="" style="margin-left: 0px; margin-right: 0px; width: 270px;"> <input type="hidden" class="textbox-value" value="北京"> </span> <script> console.log(document.getElementsByTagName("input")[1].value) </script> </body>
对应展示效果为:
这是用js实现的方法,读取的值是北京
另外用一种更加快速的方法是
browser.find_element_by_xpath(path).text
另外参杂点关于鼠标事件
需要引用的架包为:from webdriver.common.action_chains import ActionChains
具体的用法后续总结.
相关文章推荐
- Python简单爬虫
- Python爬虫之URLError异常处理
- python中eval函数使用
- Python: 什么是*args和**kwargs (
- 20来行的Python拼写检查器
- 简单实用Python程序
- python 模块加载机制
- python 多线程就这么简单
- python实例属性和类属性精讲
- Python基础——如何使用PyInstaller打包python程序
- 使用Aptana Studio 3开发python教程
- python mysql安装与使用
- calibre抓取“爱上中文”网小说的recipe
- python3之dict字典
- 【python】编程语言入门经典100例--40
- Python Show-Me-the-Code 第 0001题
- Python IDE
- 解决sublime3,python3不能输出中文问题
- python技巧
- 利用python-flask搭建个人博客