Skip to content

Instantly share code, notes, and snippets.

@pikesley
Created August 28, 2015 15:48
Show Gist options
  • Save pikesley/b9d1ccc4de4c934e89af to your computer and use it in GitHub Desktop.
Save pikesley/b9d1ccc4de4c934e89af to your computer and use it in GitHub Desktop.
Scrape Genius
require 'nokogiri'
require 'open-uri'
Nokogiri::HTML(open('http://genius.com/Taylor-swift-bad-blood-lyrics')).xpath("//div[contains(@class,'lyrics')]/p").map { |i| puts i }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment