CSS selectors¶
<html lang="en">
<head>
<title>CSS Selectors</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1 id="select-me">
<a href="#click-me">Click me.</a>
</h1>
<body>
</html>
With a CSS selector, you must specify which attribute you want returned, since there may be several.
capture:
selector: '#select-me > a'
attr: [ href ]
as: [ link ]
The above HTML would be parsed by the given expression as the string
#click-me
which would then be stored in the link
variable.