require 'open-uri'
require 'openssl'
require 'nokogiri'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
title = "European Journal of Pharmaceutical Sciences"
url = "https://en.wikipedia.org/wiki/#{title.gsub(' ','_')}"
open(url){|f|
str = f.read
doc = Nokogiri::HTML.parse(str)
puts doc.css('table.infobox > tr')[1].css('td').inner_text
}
Created
March 18, 2016 05:18
-
-
Save hirokai/6df5dcf6dd5bbfd48d40 to your computer and use it in GitHub Desktop.
Wikipediaからジャーナルの省略名を取得するRubyスクリプト
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment