Replies: 5 comments 2 replies
-
Line 13 in 0340433 |
Beta Was this translation helpful? Give feedback.
-
After I used the stealth library, I used the AcceptLanguage string attribute again, but it did not take effect. The language used was also the stealth language. |
Beta Was this translation helpful? Give feedback.
-
sure code: `package main import ( var MyDevice = devices.Device{ func main() {
} |
Beta Was this translation helpful? Give feedback.
-
Now my plan is to give up using stealth. I now hope to insert some commands in browser.EachEvent to bypass detection like https://bot.sannysoft.com/. Please tell me how I can detect Plugins Length through js code. (Old) 0 |
Beta Was this translation helpful? Give feedback.
-
I use the stealth library, but how do I change the browser's default language?
The code is as follows. How should I modify it to change the browser's stealth to the language I want?
`package main
import (
"github.com/go-rod/rod"
"github.com/go-rod/rod/lib/devices"
"github.com/go-rod/rod/lib/launcher"
"github.com/go-rod/rod/lib/proto"
"github.com/go-rod/stealth"
"time"
)
var MyDevice = devices.Device{
Title: "Chrome computer",
//Capabilities: []string{"touch", "mobile"},
UserAgent: "Mozilla/5.0 (Windows NT 18.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
//AcceptLanguage: "zh",
Screen: devices.Screen{
DevicePixelRatio: 2,
Horizontal: devices.ScreenSize{
Width: 1280,
Height: 1024,
},
Vertical: devices.ScreenSize{
Width: 1024,
Height: 1280,
},
},
}
func main() {
//path, _ := launcher.LookPath()
//extPath, err := filepath.Abs("fixtures/chrome-extension")
//if err != nil {
// fmt.Println("出错了:", err)
//}
u := launcher.New().Set("--disable-blink-features", "AutomationControlled").Set("no-first-run").Set("disable-default-apps").
//Set("--user-agent", "Mozilla/5.0 (Windows NT 19.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36").
//Set("--lang", "zh").
//Env(append(os.Environ(), "lang=zh")...).
//Set("load-extension", extPath).
Headless(false).MustLaunch()
//Headless(false).XVFB("--server-num=5", "--server-args=-screen 0 1600x900x16").MustLaunch()
}
`
Beta Was this translation helpful? Give feedback.
All reactions