- 博客(62)
- 资源 (2)
- 收藏
- 关注
原创 相机工程模式测试
#!/usr/bin/python# -*- coding: GBK -*-import osimport timeimport datetimeimport uiautomator2 as u2import subprocessfrom threading import Timerimport numpy as npfrom PIL import ImageGrabpi = subprocess.Popen("adb devices", shell=True, stdout=sub
2021-07-08 19:06:25 378 1
原创 Windows应用程序自动化测试框架demo
环境要求1 pycharm2 winappdriver https://github.com/Microsoft/WinAppDriver 脚本说明1 import 内容import timeimport unittestfrom appium import webdriverimport pyautogui 用于实现按坐标点击,双击,输入字符等内容import randomimport datetime#import psutil 用于监控进程,实际尚未使用到from s
2021-05-10 09:32:18 504 1
原创 Windows10下设置Shift+右键增加cmd的4种方法
1.shift+鼠标右键添加在当前目录打开cmd(非管理员)记事本→新建文本文档,输入下面内容,Windows Registry Editor Version 5.00[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere][HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHere]@=“在此处打开命令行窗口”“Extended”=""[HKEY_CLASSES_ROOT\Di
2021-04-14 15:03:53 1349 1
原创 定时退出while循环的方法
方法一:@echo offsetlocal enabledelayedexpansion for /l %%a in (60,-1,1) do ( adb shell "cat /proc/vmstat | grep pgpgin; cat /proc/vmstat | grep pgpgout" set ss=%%~a if !ss! lss 10 set ss=0%%~a cls & echo save time 00:00:!ss! ping
2021-04-12 18:57:00 821
原创 自动生成二维码
简单生成二维码:import qrcode # 模块导入 # 调用qrcode的make()方法传入url或者想要展示的内容img = qrcode.make('http://www.baidu.com') # 写入文件with open('test.png', 'wb') as f: img.save(f) # img.save("text.png")详细生成二维码:#!/usr/bin/python# -*- coding: utf-8 -*-import qrcodef
2021-01-25 17:58:20 242
原创 自动化测试应用WaitTime
#!/usr/bin/python# -*- coding: utf-8 -*-import osimport timeimport pandas as pd# os.system("adb reboot")# os.system("adb wait-for-device")f = open("./app_mCurrentFocus_20.txt","r")lines = f.readlines()list = []for line in lines: line1 = l
2021-01-13 10:08:31 166
原创 UIautomator自动化平台搭建及使用
自动化管理平台操作手册:APP元素定位法(实时):1.下载元素定位安装包:pip install -U uiautomator22.下载图形化界面安装包:pip install -U weditor3.打开界面获取坐标:weditor4.在手机上进行初始化安装APP:python -m uiautomator2 initATXServer设备控制:环境搭建及操作步骤:0.uiautomator2使用教程:https://github.com/openatx/uiautomator21...
2020-10-15 11:21:41 921
原创 使用ffmpeg将视频分割或合并
# //使用ffmpeg将视频分割成300秒的块# ffmpeg -i 为什么你会经常发火.mp4 -threads 3 -vcodec copy -f segment -segment_time 300 为什么你会经常发火%04d.mp4# //截取从头开始的30s# ffmpeg -ss 00:00:00 -t 00:00:30 -i keyoutput.mp4 -vcodec copy -acodec copy split.mp4# //截取从30s开始的30s# ffmpeg -ss 00
2020-09-02 11:25:31 2227
原创 手机解锁壁纸切换压力测试
import uiautomator2 as u2from uiautomator2 import Directiond = u2.connect()def test_one(): d.screen_on() # 亮屏 d.swipe_ext(Direction.FORWARD) # 上滑解锁 for i in range(6): d(description="6").click() # 输入解锁密码666666 print(d.info)
2020-08-10 19:36:33 174
原创 自动刷机脚本
import osdef restart(): os.system("adb devices") os.system("adb reboot edl")def click(): # os.system("adb shell input keyevent 26") os.system("adb shell input tap 0 636") # 选择语言--简体中文 19125 os.system("adb shell input tap 876 2236
2020-08-10 19:34:47 1508
原创 全本小说网小说爬虫
# -*- coding:utf-8 -*-import requestsfrom pyquery import PyQueryimport reimport os# 构造请求头headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, " "like Gecko) Chrome/81.0.4044.138
2020-08-06 20:20:02 337
原创 酷虎小说网爬虫
import requestsfrom pyquery import PyQueryimport reimport os# 构造请求头headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, " "like Gecko) Chrome/81.0.4044.138 Safari/537.36", "Co
2020-06-29 10:54:52 2284
原创 中文起点网小说爬虫
import osimport requestsfrom pyquery import PyQuery as pqimport reheaders = { "referer": "https://read.qidian.com/chapter/0aFVD3Gm6QUz2wAI5wVpbA2/MMVtN_lV-wDM5j8_3RRvhw2", "User-Agent": "MMozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/53
2020-06-29 10:53:16 1131
原创 将文本中关键信息保存到Excel表格中
# AFExecuteProcessRequestbegin AFExecuteProcessRequestend# main function:主要实现把txt中的关键数据写入到excel中# coding=utf-8import osimport reimport csvif __name__ == '__main__': html_path = os.getcwd() with open("评估结果.csv", "w", newline="") as csvfile
2020-06-12 14:45:08 210
原创 相机自动化拍摄脚本
import osimport time# os.system("adb shell input keyevent 26") # 点击power键亮屏# os.system("adb shell input swipe 540 1300 540 500 100") # 向上滑屏# os.system("adb shell am start -a android.media.action.STILL_IMAGE_CAMERA") # 启动cameraa = input("请输入拍照次数:")
2020-05-13 11:10:50 1246
原创 根据图片名的关键词进行分类
import osimport imghdrimport shutilimport statdef move_classification(file_path): arr_files = file_path.split("_") # print(arr_files[1]) # print(images_path) folder_path = os.pat...
2020-01-08 18:18:04 453
原创 损坏文件移除脚本
import osimport imghdrimport shutilimport tensorflow as tfdef judge_wrong_file(root_path, file_path):if imghdr.what(file_path) is None:remove(root_path, file_path)else:try:img = tf.io.read_fi...
2020-01-07 20:37:28 118
原创 cts测试环境搭建
CTS教程地址:https://source.android.com/compatibility/cts第一步:CTS包下载https://source.android.com/compatibility/cts/downloads第二步:运行前下载好adb和aapt和jdk,配好环境变量。adb安装包下载地址:https://developer.android.com/studio/r...
2020-01-02 18:29:42 688
原创 pyinstaller打包成exe文件
一.打包单个文件命令pyinstaller --onefile kugouSpider.py二.打包多个文件命令pyinstaller -option xxx.pypyinstaller基本Options参数如下:-F:打包后只生成单个exe格式文件;-D:默认选项,创建一个目录,包含exe文件以及大量依赖文件;-c:默认选项,使用控制台(就是类似cmd的黑框);-w:不使用控制台...
2019-12-19 12:05:40 1254
原创 哔哩哔哩弹幕爬虫脚本
import osimport requestsfrom bs4 import BeautifulSoupfrom pyquery import PyQueryimport reimport shutilheaders = { "Cookie": "CURRENT_FNVAL=16; stardustvideo=1; _uuid=3C5905C8-410F-D211-2688...
2019-11-14 11:45:57 1020
原创 哔哩哔哩网视频弹幕-单个爬取
# -*- coding:utf-8 -*-import requestsfrom bs4 import BeautifulSoupheaders = { "Accept": "*/*", "Accept-Language": "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3", "User-Agent": "Mozilla/5.0 (Win...
2019-11-12 18:34:29 338
原创 90设计网爬虫
# -*- coding:utf-8 -*-import osimport requestsimport urllibfrom pyquery import PyQueryimport uuidfrom pypinyin import pinyinimport unicodedataheaders = { "User-Agent": "Mozilla/5.0 (Windo...
2019-10-30 21:35:30 257
原创 顺丰优选网爬虫
# -*- coding:utf-8 -*-import osimport timeimport requestsimport urllibimport uuidfrom pyquery import PyQueryheaders = { "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/...
2019-10-30 20:38:48 448
原创 本来生活网图片爬虫
# -*- coding:utf-8 -*-import osimport timeimport requestsimport urllibimport uuidfrom pyquery import PyQueryheaders = { "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/...
2019-10-29 12:36:15 157
原创 站酷海洛网图片爬虫
# -*- coding:utf-8 -*-import osimport requestsimport urllibfrom pyquery import PyQueryimport uuidfrom pypinyin import pinyinimport unicodedataheaders = { "User-Agent": "Mozilla/5.0 (Windo...
2019-10-19 18:40:39 2264 6
原创 山东图片库图片爬虫
# -*- coding:utf-8 -*-import osimport requestsimport urllibfrom pyquery import PyQueryimport uuidfrom pypinyin import pinyinimport unicodedataheaders = { "User-Agent": "Mozilla/5.0 (Windo...
2019-10-19 16:50:51 177
原创 红动中国网图片爬虫
# -*- coding:utf-8 -*-import osimport requestsimport urllibfrom pyquery import PyQueryimport uuidfrom pypinyin import pinyinimport unicodedataheaders = { "User-Agent": "Mozilla/5.0 (Windo...
2019-10-19 16:20:49 461 1
原创 摄图网图片爬虫
# -*- coding:utf-8 -*-import osimport requestsimport urllibfrom pyquery import PyQueryimport uuidfrom pypinyin import pinyinimport unicodedataheaders = { "User-Agent": "Mozilla/5.0 (Windo...
2019-10-18 17:45:32 1370
原创 根据特殊符号进行切除并保存到新excel中脚本
import xlrdimport xlwtdef num_cut(): # ---------------------读 # 打开excel文件,创建一个workbook对象,book对象也就是fruits.xlsx文件,表含有sheet名 r_book = xlrd.open_workbook("./cs.xlsx") # xls默认有3个工作簿,She...
2019-10-18 15:51:50 148
原创 python进行excel表格数据运算脚本
#! /usr/bin/python# -*- coding: utf-8 -*-# 导入pandas模块import pandasimport xlwtimport xlrddef num_operation(): # 读取excel文件,定位sheet页 df = pandas.read_excel("./cs.xlsx", sheet_name="百分比求平...
2019-10-18 11:50:05 2613
原创 航空摄影图库图片爬虫脚本
# -*- coding:utf-8 -*-import osimport requestsimport urllibfrom pyquery import PyQueryimport uuidfrom pypinyin import pinyinimport unicodedataheaders = { "User-Agent": "Mozilla/5.0 (Windo...
2019-10-17 10:44:34 260
原创 yestone网图片爬虫
# -*- coding:utf-8 -*-import osimport timeimport requestsimport urllibimport uuidfrom pyquery import PyQueryimport jsonheaders = { "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...
2019-10-15 10:55:43 128
原创 觅元素网图片爬虫
# -*- coding:utf-8 -*-import osimport requestsimport urllibfrom pyquery import PyQueryimport uuidfrom pypinyin import pinyinimport unicodedataheaders = { "User-Agent": "Mozilla/5.0 (Windo...
2019-10-11 09:50:49 1492 2
原创 测试集等比抽取脚本
import osimport shutildef move_file(path): for root, dir, files in os.walk(path): if len(files) != 0: for file in files[:200]: # 抽取数量 url = os.path.join(ro...
2019-10-09 21:34:53 91
原创 按帧率进行视频切图脚本
#coding:utf-8import osimport argparseimport systry: import cv2except: print("Need to install OpenCV:") print("pip install OpenCV")def readVideo(videoFile, folder, videoName, timeF...
2019-10-09 21:29:28 396
原创 下厨房图片爬虫
# -*- coding:utf-8 -*-import osimport requestsimport urllibfrom pyquery import PyQueryimport uuidheaders = { "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTM...
2019-10-09 20:39:35 218
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人