测试网站:https://www.geetest.com/demo/slide-bind.html
import cv2
import base64
import asyncio
from pyppeteer import launch
launch_args = {
"headless": False,
'executablePath': r"C:\Program Files\Google\Chrome\Application\chrome.exe",
"args": [
"--start-maximized",
"--disable-infobars",
"--log-level=3",
"--enable-extensions",
"--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
],
"ignoreDefaultArgs": ['--enable-automation'] # 去除Chrome正受到自动测试软件的控制
}
# 获取屏幕尺寸
def screen_size():
"""使用tkinter获取屏幕大小"""
import tkinter
tk = tkinter.Tk()
width = tk.winfo_screenwidth()
height = tk.winfo_screenheight()
tk.quit()
return width, height
# 保存图片
async def save(filename, data):
_, img = data.split(",")
img = base64.b64decode(img)
with open(</