Documentation
¶
Overview ¶
Command selectors is a chromedp example demonstrating how to choose the elements of a page with the typed selectors. The type of the selector chooses the lookup: CSS, CSSAll, ID, JSPath, NodeIDs and a plain string, which is a search by CSS selector, XPath or text. The program loads one local page and finds elements with each type, and it prints what each lookup returns. It uses the actions Text, Nodes and Attributes with these selectors. It also uses ByFunc for a lookup of its own, and the options AtLeast and NodeVisible, which change how long a query waits. It starts a local server and needs no internet. Use -v to print the protocol messages, -visible to show the browser window and leave it open, and -visible-on-terminal to draw the page in the terminal with terminal graphics.