Comment on Show HN: Pup – A command-line HTML parserComments−mbesto11yWait, what's the difference between this and using a Ruby/Python/etc REPL? In other words, normally to achieve this same result I would do:irb -> require 'Nokogiri' and require 'open-uri' -> doc = Nokogiri::HTML(open('http://www.google.com/'))and no need to store the HTML via wget on my machine. Am I missing something?−mateuszf11yThe difference is that you don't have to know python/ruby, remember specific package names and to install them before using.−aw3c211yYou can use this with pipes and redirectors in the command line.−dashesyan11yNokogiri comes with a command-line tool for just that purpose: https://github.com/sparklemotion/nokogiri/blob/master/bin/no...Example: nokogiri https://news.ycombinator.com -e 'puts $_.css("td.title a @href")'
Comments
Wait, what's the difference between this and using a Ruby/Python/etc REPL? In other words, normally to achieve this same result I would do:
irb -> require 'Nokogiri' and require 'open-uri' -> doc = Nokogiri::HTML(open('http://www.google.com/'))
and no need to store the HTML via wget on my machine. Am I missing something?
The difference is that you don't have to know python/ruby, remember specific package names and to install them before using.
You can use this with pipes and redirectors in the command line.
Nokogiri comes with a command-line tool for just that purpose: https://github.com/sparklemotion/nokogiri/blob/master/bin/no...
Example: nokogiri https://news.ycombinator.com -e 'puts $_.css("td.title a @href")'