selectors

command
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 15 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL