Home Anna Archive spider-pig Searches for Nodes that match a CSS Selector—zachleat.com

spider-pig Searches for Nodes that match a CSS Selector—zachleat.com

17
0
SHARE

spider-pig is a command line utility that takes a URL and retrieves all the local URL links on the page. It can also search for a CSS selector on each local URL to measure the impact of a CSS change.

Homer Simpson holding up a pig upside-down pretending that it’s walking on the ceiling

Get a list of local URL links from a root URL. Works with JavaScript generated content.

<a href="test.html">Test</a>
<a href="test2.html">Test</a>
<a href="test2.html">Duplicate Test</a>
<a href="root.html">URL to self</a>
<a href="mailto:test@example.com">Email link</a>
<a href="http://www.google.com/">External</a>

Can also act as a live-DOM CSS search across multiple files (find all the templates that are using the CSS selector I want to change). If I’m worried about changing code in a CSS selector, I’ll use this tool to search for instances of the selector across my project.

spider-pig on the command line

Airing Out 2017’s Dirty Laundry—zachleat.com
Making a Simple Web Site with the Simplest Static Site Generator, Level 1—zachleat.com

LEAVE A REPLY

Please enter your comment!
Please enter your name here