[错误] 当设备像素比例为非 1 时,Element.Screenshot 会出错
作者: kvii创建于 2025年6月12日更新于 2026年9月8日
标签question
var windowsEdge = devices.Device{ Title: "Edge Laptop with HiDPI screen", Capabilities: []string{}, UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0", AcceptLanguage: "en", Screen: devices.Screen{ DevicePixelRatio: 2, // <-- note here Horizontal: devices.ScreenSize{ Width: 1600, Height: 900, }, Vertical: devices.ScreenSize{ Width: 900, Height: 1600, }, }, }.Landscape(), }
What you got
内容来源: go-rod/rod