golang qq滑块完整代码
package main
import (
"bytes"
"github.com/go-rod/rod"
"github.com/go-rod/rod/lib/devices"
"github.com/go-rod/rod/lib/launcher"
"github.com/nfnt/resize"
"image/jpeg"
"io/ioutil"
"log"
"math"
"net/http"
"strings"
"time"
"fmt"
)
var rodlauncher *launcher.Launcher
type DOMRect struct {
X float64 `json:"x"`
Y float64 `json:"y"`
Width float64 `json:"width"`
Height float64 `json:"height"`
}
func main(){
screen := devices.Device{
Title: "Laptop with MDPI screen",
Capabilities: []string{
"touch", "mobile"},
UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36",
Screen: devices.Screen{
DevicePixelRatio: 1,
Horizontal: devices.ScreenSize{
Width: 1280,
Height: 720,
},
},
}
rodlauncher = launcher.New().
Bin("/Users/gitxuzan/go/src/goBoss/web_test_driver/silde_captcha_v2/Chromium.app/Contents/MacOS/Chromium").
Set("mute-audio").
Set("default-browser-check").
Set("disable-gpu").
Set("disable-web-security").
Set("no-sandbox").
Delete("headless")
launchers := rodlauncher.MustLaunch()
fmt.Printf(