Open bazuker opened 4 months ago
Please fix the format of your markdown:
31 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"]
31 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
generated by check-issue
Just confirmed that almost any operation on that frame
will results in panic. I tried frame.Element
, frame.Has
etc
This code works fine to me, no matter it's headless or not:
package main
import (
"fmt"
"github.com/go-rod/rod"
"github.com/go-rod/rod/lib/launcher"
)
func main() {
u := launcher.New().Headless(false).MustLaunch()
page := rod.New().ControlURL(u).MustConnect().MustPage("https://dash.cloudflare.com/sign-up")
f := page.MustElement(`iframe[src*="https://challenges.cloudflare.com"]`).MustFrame()
fmt.Println(f.MustElement("#success").MustHTML())
}
@ysmood you can try for yourself on this page Select a park, pick a date and time and press next. You will see cloudflare iframe that makes the code panic.
Also, I am running a managed version of Rod in docker, if that makes a difference.
My configuration:
l = launcher.MustNewManaged(serviceURL).
UserDataDir(userDataDir).
Headless(false).
Devtools(false).
Leakless(true).XVFB("--server-num="+strconv.Itoa(serverID), "--server-args=-screen 0 1600x900x16")
l.NoSandbox(true)
l.Set("disable-web-security")
l.Set("disable-blink-features", "AutomationControlled")
l.Delete("enable-automation")
l.Delete("disable-site-isolation-trials")
br.browser.Client(l.MustClient())
err = br.browser.Connect()
if err != nil {
return fmt.Errorf("failed to connect to browser: %w", err)
}
br.browser.MustIncognito()
how to bypass cloudflare challenge?
@bazuker I even can't open the page, when I use my personal browser to navigate to it I got a blank page and error in console:
@ysmood not sure where you are geographically located but this website definitely works in North America. This is the official website of British Columbia recreational parks and trails booking
It works fine to me:
https://github.com/go-rod/rod/assets/1415488/a6a21591-a54c-4fc2-9fa4-78f963bb6417
Rod Version: v0.116.1
The following code panics when
frame.HTML()
is called.frame
is confirmed not to benil
.I can provide full iframe HTML code if necessary.
The code to demonstrate your question
Log and stack trace