chromedp / chromedp

A faster, simpler way to drive browsers supporting the Chrome DevTools Protocol.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chromedp.TextContent is used to retrieve the text content of a web page element. When the element is not present, the program cannot proceed and remains stuck at this point.

yyil80 opened this issue · comments

If the element "page-root" does not exist, there will be no error, and "testVal" will not be printed.

err := chromedp.Run(ctx,
	chromedp.TextContent("#page-root", &testVal),
)

if err != nil {
	fmt.Println(err)
}
fmt.Println("testVal=", testVal)

What should I do?