Skip to content

Instantly share code, notes, and snippets.

@nybblr
Created April 5, 2014 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nybblr/9987011 to your computer and use it in GitHub Desktop.
Save nybblr/9987011 to your computer and use it in GitHub Desktop.
# Gemfile
ruby '2.1.1'
gem 'nokogiri'
gem 'pry'
# scrapey.rb
require 'rubygems'
require "net/http"
require "uri"
require "pry"
require "nokogiri"
query = "1+peter+3"
uri = URI.parse("http://www.biblegateway.com/passage/")
uri.query = "search=#{query}"
response = Net::HTTP.get_response(uri)
body = response.body
page = Nokogiri::HTML(body)
passage = page.css('.passage .text')
puts passage.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment