Skip to content

Instantly share code, notes, and snippets.

@koshian
Created July 20, 2015 08:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koshian/7d15fce2183a0eea1aca to your computer and use it in GitHub Desktop.
Save koshian/7d15fce2183a0eea1aca to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
require 'nokogiri'
uri = ARGV[0]
query = ARGV[1]
doc = Nokogiri::HTML.parse(open(uri).read)
doc.search(query).each do |e|
puts e.inner_html
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment