Skip to content

Instantly share code, notes, and snippets.

@saboyutaka
Created August 2, 2018 12:00
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 saboyutaka/cb63af83ef2b18272b16f11607b00b90 to your computer and use it in GitHub Desktop.
Save saboyutaka/cb63af83ef2b18272b16f11607b00b90 to your computer and use it in GitHub Desktop.
スクレイピングの実演
require 'nokogiri'
require 'httparty'
url = 'https://www.ryukyu-frogs.com/information/'
res = HTTParty.get(url)
doc = Nokogiri::HTML.parse(res.body)
doc.css('.news-list li').each do |node|
puts node.css('.content .title').text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment