webdriver

Selenium打开火狐/google浏览器失败提示WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

笑着哭i 提交于 2020-03-04 07:52:56
如果你的selenium是3.X版本的,火狐浏览器需要geckodriver这个组件的支持,而谷歌浏览器需要chromedriver的支持,2.X版本则不需要。 使用selenium自动打开Google浏览器错误提示: WebDriverException: Message: 'chromedriver' executable needs to be in PATH. 打开火狐浏览器错误提示: C:\Python36\lib\site-packages\selenium\webdriver\firefox\webdriver.py in __init__(self, firefox_profile, firefox_binary, timeout, capabilities, proxy, executable_path, firefox_options, log_path) 140 capabilities.pop("marionette") 141 self.service = Service(executable_path, log_path=log_path) --> 142 self.service.start() 143 144 capabilities.update(firefox_options.to_capabilities()) C:\Python36\lib

App自动化01-Appium概述

梦想的初衷 提交于 2020-03-03 11:42:36
Appium简介 Appium是一个开源、跨平台的测试工具,可以用来测试原生及混合的移动端应用。Appium支持IOS、Android及Windows 平台。Appium使用WebDriver的json wire协议,来驱动IOS系统的UIAutomation库、Android系统的UIAutomator框架。它允许测试人员在不同的平台(iOS,Android)使用同一套API来写自动化测试脚本,这样大大增加了iOS和Android测试套件间代码的复用性。下面的是为其官网上面的介绍: Appium is an open-source tool you can use to automate mobile native, mobile web, and mobile hybrid applications on iOS and Android platforms. “Mobile native apps” are those written using the iOS or Android SDKs. “Mobile web apps” are web apps accessed using a mobile browser (Appium supports Safari on iOS and Chrome on Android). “Mobile hybrid apps” have

TypeError: required field “posonlyargs” missing from arguments error running a Pytest Script on Python 3.8.1

半腔热情 提交于 2020-03-03 10:01:28
问题 I created a Simple Selenium Pytest automation script on Python 3.8.1. After running the script I see the below error: Traceback (most recent call last): . . . Error messages . . TypeError: required field "posonlyargs" missing from arguments I googled and saw that this seems to be an issue with Python 3.8.1. Any suggestions on how to avoid this error? I could always go back to the previous Python version (3.8.0), but I'm keeping that as the last option. 回答1: This error message... TypeError:

TypeError: required field “posonlyargs” missing from arguments error running a Pytest Script on Python 3.8.1

試著忘記壹切 提交于 2020-03-03 10:01:07
问题 I created a Simple Selenium Pytest automation script on Python 3.8.1. After running the script I see the below error: Traceback (most recent call last): . . . Error messages . . TypeError: required field "posonlyargs" missing from arguments I googled and saw that this seems to be an issue with Python 3.8.1. Any suggestions on how to avoid this error? I could always go back to the previous Python version (3.8.0), but I'm keeping that as the last option. 回答1: This error message... TypeError:

selenium webdriver python 开始

喜你入骨 提交于 2020-03-03 04:56:46
学习资料: Selenium with Python:   http://selenium-python.readthedocs.org/en/latest/index.html 乙醇的python selenium教程: https://github.com/easonhan007/webdriver_guide/blob/master/README.md Official user guide for Selenium: https://github.com/SeleniumHQ/www.seleniumhq.org 虫师的selenium教程:   http://www.cnblogs.com/fnng/category/349036.html Unittest 官方教程:   https://docs.python.org/3/library/unittest.html python webdriver 参数化教程: http://wenku.baidu.com/link?url=jLE8MVKYjREHepDuY8ALeDNgo6zQh020vvKBNp3K-2fHQAqFDKXVfKkSWou4Rl1iGOZT62_gonRMVg0zAriu5B6PxjhD0mDf281yhTU59cS 其他 Selenium WebDriver主要用来写 functional

第二次小组实践作业小组每日进度汇报:2017-11-25

自古美人都是妖i 提交于 2020-03-03 04:06:17
小组成员共同完成的工作:共享“花样校园网站系统代码”,配置Java环境,下载安装intellijIDEA为编译软件。 小组成员进度汇报: (1)姜黎黎:实际运行成功系统后,参照网络上其他校园网站文档,编写完成引言和用户个人信息管理模块。包括系统开发背景、任务目标、针对的用户、开发环境和第三方接口等。运行系统+撰写文档共用时2个小时。下一步计划结合系统实际运行情况,撰写物品供求与订单管理模块的需求文档。 (2)李嘉蕊:运行系统后,分析并完成用户个人信息管理模块测试用例设计工作。包括:注册功能、用户/管理员登录功能、修改密码和忘记密码功能。运行系统+撰写文档共用时2个小时。下一步计划分析并完成物品供求与订单管理模块的测试用例设计。 (3)侯俊:安装好测试工具Selenium编写完成用户个人信息管理模块的脚本文档。包括:安装测试工具、逐步解决安装过程遇到的问题、编写脚本、编译脚本。安装工具+完成脚本共用时3小时。下一步计划完成物品供求与订单管理模块的脚本设计与编写。 (4)唐伟:运行脚本文档,结合测试用例,完成对应缺陷报告。包括:指导小组成员安装测试工具、运行系统、撰写缺陷报告。运行系统+运行脚本共用时2个小时。下一步计划完成物品供求与订单管理模块的脚本运行和撰写缺陷报告工作。 (5)郭义:记录测试过程,在运行测试脚本的同时,记录下每一步输入和输出的测试过程。包括

chrome中的selenium插件----katalon recorder

妖精的绣舞 提交于 2020-03-03 00:38:39
就是这个东东 使用方法: 先开始录制,我这里是打开了豆瓣,然后点击了电影,然后选中export 导出为python: 在这个方法中,复制方块内的内容到python中 1.导入包webdriver 2.给driver赋值:这里的Chrome是一个class,所以是大写的,webdriver包中还有一个chrome,一个小写的包,当时没看清,导入错了,结果就error 然后看一下: 还有一种。不让浏览器弹出来的操作: 但最后看到的,都是js????????这里有点懵 来源: CSDN 作者: white煞 链接: https://blog.csdn.net/weixin_44841849/article/details/104620377

python爬虫之selenium、phantomJs

蹲街弑〆低调 提交于 2020-03-02 20:01:18
图片懒加载技术 什么是图片懒加载技术 图片懒加载是一种网页优化技术。图片作为一种网络资源,在被请求时也与普通静态资源一样,将占用网络资源,而一次性将整个页面的所有图片加载完,将大大增加页面的首屏加载时间。为了解决这种问题,通过前后端配合,使图片仅在浏览器当前视窗内出现时才加载该图片,达到减少首屏图片请求数的技术就被称为“图片懒加载”。 如何实现图片懒加载技术 在网页源码中,在img标签中首先会使用一个“伪属性”(通常使用src2,original......)去存放真正的图片链接而并非是直接存放在src属性中。当图片出现到页面的可视化区域中,会动态将伪属性替换成src属性,完成图片的加载。 如何破解图片懒加载技术 其实很简单,在对标签属性进行定位的时候,仔细观察它真正的属性进行提取。 例如: import requests from lxml import etree def main(): responses = requests.get(url=url, headers=headers) coding = responses.apparent_encoding responses.encoding = coding res_text = responses.text # 创建etree对象 tree = etree.HTML(res_text) div_lst = tree

爬虫框架之selenium

假如想象 提交于 2020-03-02 20:00:53
Selenium 一、概述 Web自动化测试工具,可以运行在浏览器,根据指令操作浏览器 只是工具,必须与第三方浏览器结合使用 安装: Linux: sudo pip3 install selenium Windows: python -m pip install selenium phantomjs浏览器 定义:无界面浏览器(又称无头浏览器),在内存中进行页面加载,高效 安装(phantomjs、chromedriver、geckodriver) Windows: 1、下载对应版本的phantomjs、chromedriver、geckodriver 2、把chromedriver.exe拷贝到python安装目录的Scripts目录下(添加到系统环境变量) # 查看python安装路径: where python 3、验证 cmd命令行: chromedriver # 下载地址 # 查看浏览器版本:右上角-帮助-关于google Chrome # 网站中查看对应版本(notes.txt) chromedriver : 下载对应版本 http://chromedriver.storage.googleapis.com/index.html Linux: 1、下载后解压 tar -zxvf geckodriver.tar.gz 2、拷贝解压后文件到 /usr/bin/ (添加环境变量

nodejs selenium

 ̄綄美尐妖づ 提交于 2020-03-02 19:59:19
https://www.npmjs.com/package/selenium-webdriver https://www.selenium.dev/selenium/docs/api/javascript/index.html 驱动下载地址 https://github.com/mozilla/geckodriver/releases/ 0.26.0版本驱动 支持chrome 71~75 firefox 0.26.0 支持目前最新的版本 将下载的驱动和文件放到一起或者加入path 截图百度搜索 const {Builder, By, Key, until, Options} = require('selenium-webdriver'); const fs = require('fs'); const firefox = require('selenium-webdriver/firefox'); function waitTime(n) { return new Promise(resolve => setTimeout( () => resolve() , n )) } (async function example() { let options = new firefox.Options() options.headless() let driver = await new