web应用程序测试工具(录制、编写、运行、测试并行处理) ,可以访问chrome,改脚本就行 点点点 https://github.com/mozilla/geckodriver/releases/文章目录
理解
api 编辑 并行测试
脚本(client)-驱动-浏览器(server)-服务器
2.0版本升级
示例
配置环境
驱动
版本号对应下载驱动
保存到本地
火狐驱动
girhub解压缩保存
测试
ide
录制
失败是由于广告算法推荐导致没有内容重现
导出脚本
ide只需一个
实验
脚本分析忽略鼠标滑过
常用类库安装
验证urllib库是否安装
C:Userswangwei>python Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import urllib >>> import urllib.request >>> urllib.request.urlopen('https://www.baidu.com') <http.client.HTTPResponse object at 0x000001D702358048> >>> import re
安装requests
C:Userswangwei>pip.exe install requests C:Userswangwei>python Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> requests.get('https://www.baidu.com') <Response [200]>
安装selenium
C:Userswangwei>pip.exe install selenium
安装chromedriver
https://npm.taobao.org/mirrors/chromedriver/
安装FireFox WebDriver
测试
>>> from selenium import webdriver >>> driver=webdriver.Chrome() DevTools listening on ws://127.0.0.1:9973/devtools/browser/4e81b3a4-c889-430c-8948-1bbecb3c2933 [33028:51916:0507/222623.575:ERROR:browser_switcher_service.cc(238)] XXX Init() >>> driver.get('https://www.baidu.com')
phantomJS无界面浏览器
C:Userswangwei>python Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from selenium import webdriver >>> driver=webdriver.PhantomJS() C:UserswangweiAnaconda3libsite-packagesseleniumwebdriverphantomjswebdriver.py:49: UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless ' >>> driver.get('https://www.baidu.com') >>> driver.page_source
lxml
C:Userswangwei>pip.exe install lxml
beautifulsoup4
C:Userswangwei>pip.exe install beautifulsoup4 C:Userswangwei>python Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from bs4 import BeautifulSoup >>> soup=BeautifulSoup('<html></html>','lxml') >>>
pyquery
C:Userswangwei>pip.exe install pyquery C:Userswangwei>python Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from pyquery import PyQuery as pq >>> doc =pq('<html>Hello</html>') >>> result=doc('html').text() >>> result 'Hello' >>>
pymysql
C:Userswangwei>pip.exe install pymysql C:Userswangwei>python Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import pymysql >>> conn =pymysql.connect(host='localhost',user='root',password='root',port=3306,db='mysql') >>> cursor=conn.cursor() >>> cursor.execute('select * from db') 2
安装flask
C:Userswangwei>pip.exe install flask C:Userswangwei>python Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import flask >>>
安装Django
C:Userswangwei>pip.exe install django C:Userswangwei>python Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import django
安装Jupyter
C:Userswangwei>pip.exe install jupyter 启动notebook C:Userswangwei>jupyter notebook
本网页所有视频内容由 imoviebox边看边下-网页视频下载, iurlBox网页地址收藏管理器 下载并得到。
ImovieBox网页视频下载器 下载地址: ImovieBox网页视频下载器-最新版本下载
本文章由: imapbox邮箱云存储,邮箱网盘,ImageBox 图片批量下载器,网页图片批量下载专家,网页图片批量下载器,获取到文章图片,imoviebox网页视频批量下载器,下载视频内容,为您提供.
阅读和此文章类似的: 全球云计算