#!/usr/local/bin/ruby require 'open-uri' require "pp" #
¥160
#https://www.google.co.jp/search?site=&q=新宿~渋谷 電車 from = "渋谷" to = "新宿" url = "https://www.google.co.jp/search?site=&q=shinjuku to shibuya train" sio = OpenURI.open_uri(url) fares = [] min_fare = 0 sio.each_line do |l| if l =~ %r|tdu-total-fare| # i = l.slice(%r|([0-9]*)|, 1) pp l # fares << i end end pp fares #min_fare = fares.sort.shift #pp min_fare