1

I have the following code and I am try to understand how to add some options :

func main() {
    // r := client.NewClient(&client.Options{AllocatorOptions: []chromedp.ExecAllocatorOption{
    //  chromedp.Headless,
    // }),
    var buf []byte
    geziyor.NewGeziyor(
        &geziyor.Options{
            StartRequestsFunc: func(g *geziyor.Geziyor) {
                g.GetRendered("https://nowsecure.nl/", g.Opt.ParseFunc)
            },
            ParseFunc: func(g *geziyor.Geziyor, r *client.Response) {
                fmt.Println(string(r.Body))
            },
            PreActions: []chromedp.Action{
                chromedp.Navigate("https://nowsecure.nl/"),
                chromedp.FullScreenshot(&buf, 90),
                chromedp.Headless(),
                // chromedp.WaitReady("body > div.nonhystericalbg > div"),
                chromedp.ActionFunc(func(ctx context.Context) error {
                    node, err := dom.GetDocument().Do(ctx)
                    if err != nil {
                        return err
                    }
                    body, err := dom.GetOuterHTML().WithNodeID(node.NodeID).Do(ctx)
                    fmt.Println("HOLAAA", body)
                    return err
                }),
            },
            RobotsTxtDisabled: true,
            Timeout:           10,
            CookiesDisabled:   false,
            MaxRedirect:       3,
            UserAgent:         "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0",
        }).Start()

    if err := os.WriteFile("fullScreenshot.jpeg", buf, 0644); err != nil {
        log.Fatal(err)
    }
    fmt.Println("wrote fullScreenshot.jpeg")
}

Is it possible to add there also some flags, like NoFirstRun or NoDefaultBrowserCheck?

Thanks in advance!

SonyMag
  • 141
  • 7

0 Answers0