selenium-python iframe用法
易迅的登录方法,因为页面有很多iframe的内置框架,需要先逐级定位到登录元素所在的iframe才行
使用方法switch_to_frame('id-name')
from selenium import webdriver
from selenium.webdriver.common.keys import Keys driver = webdriver.Chrome()
driver.get("http://item.yixun.com/item-712354.html?YTAG=3.21012000") driver.find_element_by_id("j_login").click() driver.switch_to_frame('id_iframe_login')
driver.switch_to_frame('qq_login_iframe')
driver.switch_to_frame('xui')
driver.find_element_by_id('img_out_306327209').click() driver.quit()
selenium-python iframe用法的更多相关文章
- selenium+python cooking用法 (转)
selenium-webdriver(python)--cookie处理 driver.get_cookies() 获得cookie信息 add_cookie(cookie_dict) 向cooki ...
- python爬虫---selenium库的用法
python爬虫---selenium库的用法 selenium是一个自动化测试工具,支持Firefox,Chrome等众多浏览器 在爬虫中的应用主要是用来解决JS渲染的问题. 1.使用前需要安装这个 ...
- Python之Selenium的爬虫用法
Selenium 2,又名 WebDriver,它的主要新功能是集成了 Selenium 1.0 以及 WebDriver(WebDriver 曾经是 Selenium 的竞争对手).也就是说 Sel ...
- python selenium中iframe切换、window切换方法
一.selenium中iframe切换方法: 方法一:switch_to.frame frame函数中提供了三种定位方法:by index, name, or webelement. driver.s ...
- Selenium定位iframe动态ID
Selenium定位iframe动态ID. 126邮箱实例 买了本虫师的书来学习selenium2自动化测试,然后写第一个实例就遇到了一些坑,好在有热心的网友提供了帮助,解决了问题 要学习seleni ...
- python爬虫积累(一)--------selenium+python+PhantomJS的使用(转)
阅读目录 一.Selenium介绍 二.爬虫为什么要用selenium? 三.PhantomJS介绍 四.PhantomJS安装 五.操作实战 六.在此推荐虫师博客的学习资料 selenium + p ...
- python爬虫积累(一)--------selenium+python+PhantomJS的使用
最近按公司要求,爬取相关网站时,发现没有找到js包的地址,我就采用selenium来爬取信息,相关实战链接:python爬虫实战(一)--------中国作物种质信息网 一.Selenium介绍 Se ...
- 模拟登陆百度以及Selenium 的基本用法
模拟登陆百度,需要依赖于selenium 模块,调用浏览器,执行python命令 先来说一下这个selenium模块啦...... 本文参考内容来自 Selenium官网 SeleniumPython ...
- 13、Selenium+python+API分类总结
Selenium+python+API分类总结 http://selenium-python.readthedocs.org/index.html 分类 方法 方法描述 客户端操作 __init__( ...
- Selenium WebDriver高级用法
Selenium GitHub地址 选择合适的WebDrvier WebDriver是一个接口,它有几种实现,分别是HtmlUnitDrvier.FirefoxDriver.InternetExplo ...
随机推荐
- Java基础知识强化之多线程笔记05:Java中继承thread类 与 实现Runnable接口的区别
1. Java中线程的创建有两种方式: (1)通过继承Thread类,重写Thread的run()方法,将线程运行的逻辑放在其中. (2)通过实现Runnable接口,实例化Thread类. 2. ...
- No saved view state could be found for the view identifier
解决方法: javax.faces.application.ViewExpiredException:No saved view state could be found for the view i ...
- String类的方法2
---恢复内容开始--- .ToLower() //转为小写字符串"AbC"-->"abc" .ToUpper() //转为大写"A ...
- Win10 VMware虚拟机无法打开内核设备“\\.\Global\vmx86“
前几项与Win7配置相同 用管理员模式打开CMD 运行 net start vmci net start vmx86 net start VMnetuserif 这三条命令 为了不用每次启动都这样,修 ...
- Eclipse中web项目的默认发布路径改为外部Tomcat中webapp路径
可参考http://www.cnblogs.com/mihu/p/4772509.html 和http://www.cnblogs.com/dyllove98/archive/2013/06/07/3 ...
- xhtml+css基础知识1
样式 行间样式:在标签里 <div style="width:400px; height:200px; background:red;">块</div> 内 ...
- js取单选按钮,复选按钮的值
$("input[name=PType]").bind('click', function () { if ($(this).prop("checked")) ...
- Ubuntu 16.04 - python3 安装mysql驱动
阿西吧,今天碰到一件特别蛋疼的事,给Ubuntu安装Python的MySQL驱动,驱动显示安装成功了 pip install mysql-connector 但是 在程序中导入,老是报错. Trace ...
- Cocos2d-JS中的精灵菜单和图片菜单
精灵菜单的菜单项类是cc.MenuItemSprite,图片菜单的菜单项类是cc.MenuItemImage.由于cc.MenuItemImage继承于cc.MenuItemSprite,所以图片菜单 ...
- 【Unity3D实战】摇摆直升机开发实战(一)
[Unity3D实战]摇摆直升机开发实战(一) 1.点击[Assets],创建[Sprites]和[Resources]文件夹,然后将所需要的素材导入[Sprites]文件夹中. 2.找到[Sprit ...