NAME

css - search HTML documents by CSS selectors

SYNOPSIS

css [-c0h] [-m num] pattern [file...]

DESCRIPTION

Foo.

FLAGS

-c

Count hits, rather than enumerating them.

-0

Use a NUL terminator for interoperability with other programs.

-m num

Limit search to num hits.

EXIT STATUS

0

Success.

64

Indicates a usage problem, such as passing an invalid flag or using a malformed selector.

70

An internal program error occurred whilst grepping the document.

74

An I/O error caused by failure to read or write to disk.

EXAMPLE

Given the followig HTML document, blog.html:

        <!doctype html>
        <meta charset=utf-8>
        <title>My first blog post</title>
        <meta name=keywords content=blog,first,hello>
        <meta name=description content="First entry to blog.">

To find all occurrences of <meta> elements:

        % css meta blog.html
        <meta content="blog,first,hello" name="keywords">
        <meta content="First entry to blog." name="description">

And to only look for <meta> elements with a name attribute equal to "keywords" and a content attribute containing "blog" in a space-separated list:

        % css meta[name=keywords][content~=blog] blog.html
        <meta content="blog,first,hello" name="keywords">

It can also receive streaming content from stdin:

        % curl -L https://sny.no/ | css title
        <title>Andreas Tolfsen</title>

SEE ALSO

grep(1), sed(1), awk(1)