Friday, October 31, 2008

Html Grep

Ever wanted to grep through the page contents and extract only interesting tags like all meta tags? Or maybe you wanted to print out contents of a tag with given id?

Now it's simple: html grep.

Usage is: htmlgrep.rb selector (file or url). It also accepts STDIN

Examples:


htmlgrep.rb input "http://www.google.com/"
cat index.html | htmlgrep.rb "div#users"
htmlgrep.rb "div#users" index.html

1 comments:

Anonymous said...

I just wrote the exact same program, and when I was about to add it to my list of utilities it occurred to me to ask google if it already existed. Thanks!