Skip to content

Instantly share code, notes, and snippets.

@satococoa
Created May 18, 2012 07:12
Show Gist options
  • Select an option

  • Save satococoa/2723728 to your computer and use it in GitHub Desktop.

Select an option

Save satococoa/2723728 to your computer and use it in GitHub Desktop.
# usage: $ bundle exec ruby get_all_pdfs.rb | xargs -n 1 curl -O
require 'bundler/setup'
require 'nokogiri'
require 'open-uri'
require 'pp'
page_url = URI.parse('https://developer.apple.com/jp/devcenter/ios/library/japanese.html')
doc = Nokogiri::HTML(open(page_url))
doc.search('a[href$="pdf"]').each do |link|
puts page_url + link[:href]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment