go-rod / rod

A Chrome DevTools Protocol driver for web automation and scraping.

Home Page:https://go-rod.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I get Ifram without using--disable-site-isolation-trials?

m7rick opened this issue · comments

Rod Version: v0.116.1

The code to demonstrate your question

func TestRod() {
        u := "ws://localhost:51268/devtools/browser/d7231f3d-56e0-4e7c-91d7-85a8da8820b7"
	log.Println(u)
	browser := rod.New().ControlURL(u).MustConnect()
        page := browser.MustPage("https://2captcha.com/demo/cloudflare-turnstile").MustWaitLoad()

	log.Println(page.MustInfo().Title)


	iframePage:= page.MustSearch(`iframe`).MustFrame()
	a := iframePage.MustHTML()
	log.Println(a)
	text := iframePage.MustElement("#challenge-stage > div > label > span.cb-lb-t").MustText()

	fmt.Println(text)
	iframePage.MustElement("#challenge-stage > div > label > input[type=checkbox]").MustClick()
}

What you got

panic: runtime error: invalid memory address or nil pointer dereference

What you expect to see

How do I get Ifram without using--disable-site-isolation-trials?

What have you tried to solve the question

chrome kernel: "Chrome/124.0.6367.223"
Adding "--disable-site-isolation-trials" to the browser will solve the problem, but adding this parameter will cause cloudflare-turnstile to loop indefinitely

Please fix the format of your markdown:

31:65 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
33 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## What have you tried to solve the question"]

generated by check-issue

Even I remove the "--disable-site-isolation-trials" it will still fail to pass the bot detection, I think it's something else that blocks you. You'd better to research how cloudflare-turnstile works.

Thank you

@m7rick remove --disable-site-isolation-trials anyway
2
and use the old fashion way here #548 (comment)