Mushishi Selenium2 + Python_4, webdriver API

Outline
P70——WebDriver API
P83-- control of the browser
P86-- simple elements operating
P92-- keyboard events and obtain authentication information (expected results)
P95-- elements disposed Wait: to wait a display waiting and implicit
Positioning a group of elements P100--
P104-- a multi-form switching
P106-- multi-window switch
P108-- alert box processing
P110-- upload files
P116-- Download file
P117-- operation cookie
P120-- call JavaScript
P123-- handle HTML5 video player
P124-- window Screenshot
P125-- close the window and a verification code processing
P128 - WebDriver principle
text
P70——WebDriver API
Eight elements in common positioning methods
id
find_element_by_id("kw")
name
find_element_by_name("wd")
class name
find_element_by_class_name("s_ipt")
tag name
find_element_by_tag_name("input")
link text
find_element_by_link_text ( "News")
partial link text, the text portion is positioned between an element by element tag information
find_element_by_partial_link_text ( "a very long")
xpath
find_element_by_xpath(“//input[@id='kw']”)
css selector
find_element_by_css_selector("#kw")
 
P83-- control of the browser
P86-- simple elements operating
clear():清除文本
send_key(*value):模拟按键输入
click():单击元素
P89——鼠标事件
context_click():右击
double_click():双击
drag_and_drop():拖动
move_to_element():鼠标悬停
P92——键盘事件和获得验证信息(预期结果)
校验信息:driver.title,driver.current_url,元素.text
 
P95——设置元素等待:显示等待和隐式等待
P100——定位一组元素
P104——多表单切换
P106——多窗口切换
P108——警告框处理
P110——上传文件
P116——下载文件
P117——操作cookie
P120——调用JavaScript
P123——处理HTML5的视频播放
P124——窗口截图
P125——关闭窗口和验证码处理
  1. 去掉验证码
  2. 设置万能验证码
  3. 验证码识别技术:python-tesseract
  4. 记录cookie:找到用户名和密码对应的key值
  5. 查询数据库,自己想到的
 
P128——WebDriver原理
 

Guess you like

Origin www.cnblogs.com/TomBombadil/p/10977531.html