Selenium
Ceres爱吃鱼
这个作者很懒,什么都没留下…
展开
-
解决Selenium驱动火狐浏览器出错ConnectionAbortedError: [WinError 10053]
今天使用Selenium时出现了这个错误:ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine使用以下语句,可以打开火狐浏览器,但是无法打开百度网页,而是直接出了上述错误,已建立的连接已被主机中的软件中止。f...原创 2018-08-02 14:57:27 · 5284 阅读 · 0 评论 -
Selenium ( Java ) 实例二
目的:验证网易云相册的评论功能 步骤:访问网易云相册首页——登录账号——进入我的相册——进入每个相册并添加评论import java.util.List;import java.util.concurrent.TimeUnit;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;import or...原创 2018-08-14 23:00:07 · 722 阅读 · 1 评论 -
Selenium ( Python & Java ) 简单实例一
实现功能打开浏览器——访问百度首页——搜索关键词“selenium”——打开搜索结果页的前五个链接并输出各自的Title和URLPythonfrom selenium import webdriverfrom selenium.webdriver.common.keys import Keysfrom selenium.webdriver.common.action_chains...原创 2018-08-13 11:20:07 · 1000 阅读 · 0 评论 -
Selenium(Java)——页面滚动
方法一:利用Selenium里的Actions和Keys模拟键盘操作,从而控制页面滚动。方法二:利用JavaScript实现页面滚动。代码如下:package com.ceres.demos;import org.openqa.selenium.Keys;import org.openqa.selenium.WebDriver;import org.openqa.seleni...原创 2019-03-19 22:34:58 · 6004 阅读 · 0 评论 -
Selenium(Java)——日期控件定位及操作
以12306网站的日期控件为例,定位该控件并输入自定义日期。思路:1. 查看元素,发现日期输入框有readonly属性;2. 利用js去掉readonly属性,将控件变为可编辑状态;3. 清空输入框中数据(如果有),输入自定义日期。代码:package com.ceres.demos;import org.openqa.selenium.By;import or...原创 2019-03-21 22:23:08 · 3662 阅读 · 0 评论