Skip to content

chromedp.Dump doesn't work #866

@feeops

Description

@feeops

the code

package main

import (
	"context"
	"fmt"
	"github.com/chromedp/chromedp"
	"os"
)

func run() {

	t := "https://www.youtube.com"

	allocatorCtx, _ := chromedp.NewRemoteAllocator(context.Background(), "ws://127.0.0.1:9222")
	ctx, _ := chromedp.NewContext(allocatorCtx)
	var url string
	if err := chromedp.Run(ctx, []chromedp.Action{
		chromedp.Navigate(t),
		// chromedp.Sleep(10 * time.Second),

		chromedp.Location(&url),
		chromedp.Dump("html", os.Stdout),
	}...); err != nil {
		fmt.Println("t", err)
	}

	fmt.Println("URL:", url)

}

func main() {

	run()
}

output

t context canceled
URL: https://www.youtube.com/
 ./lightpanda version
bdc49a6

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions