這個博客記錄的非常好,而且很實用,不要臉的我轉(zhuǎn)載了一下,做一下記錄
一. driver常用方法

image
二. 常用定位

image

image

image

image
三. 元素在頁面不可見區(qū)域

image
四. iframe的操作

image
五. 頁面彈出框:加等待時間

image
六. windows彈出框

image
七. 鼠標操作

image
八. 下拉列表
注意:下圖中Select類引入不對
應該為 from selenium.webdriver.support.select import Select

image
九. 窗口切換

image
十. 上傳操作

image
十一. 富文本框的處理
參見文章:《selenium對富文本框的處理》
十二. 繞過登錄
參見文章:《利用ChromeOptions()加載用戶配置》
《selenium webdriver如何添加cookie》