Selenium+WebDriver
文章平均质量分 70
Tgirl_qiao
这个作者很懒,什么都没留下…
展开
-
WebDriver API 之模拟组合按键操作
需要安装的依赖模块:import win32clipboard as wimport win32con首先需要导入依赖包:from selenium.webdriver.common.keys import Keysfrom selenium.webdriver import ActionChains模拟组合键ctrl+c:ActionChains(self.driver).key_down(...原创 2018-06-07 10:05:12 · 996 阅读 · 0 评论 -
使用JavaScript操作页面元素
from selenium import webdriverfrom selenium.common.exceptions import WebDriverExceptionimport unittestimport tracebackfrom time import sleepclass TestJS(unittest.TestCase): def setUp(self): se...原创 2018-06-08 10:57:12 · 432 阅读 · 0 评论 -
操作Web页面滚动条
滑动页面的命令:# 绝对位置window.scrollTo(0,document.body.scrollHeight);window.scrollTo(0,50);# 相对位置移动scrollBy(0,50);scrollTo和scrollBy区别 View类的源代码如下所示,mScrollX记录的是当前View针对屏幕坐标在水平方向上的偏移量,而mScrollY则是记录的时当前Vi...原创 2018-06-08 12:49:44 · 1876 阅读 · 2 评论 -
Ajax浮动框选择关键字选项
from selenium import webdriverfrom selenium.common.exceptions import NoSuchElementExceptionfrom selenium.common.exceptions import WebDriverExceptionfrom selenium.webdriver.common.keys import Keysi...原创 2018-06-08 17:54:37 · 255 阅读 · 0 评论