LoginSignup
2
3

More than 5 years have passed since last update.

Ruby Nokogiri で.jspページの情報が取得できない

Last updated at Posted at 2014-07-19

最近Rubyの勉強を初め、nokogiriを使ってスクレイピングを行おうとしたものの『.jsp』の使われているページ情報を取得することができません。
どなたかご教授願います。

nokogir.rb

require 'open-uri'
require 'nokogiri'

url = 'http://plus.timescar.jp/view/station/detail.jsp?scd=U001'

charset = nil
html = open(url) do |f|
    charset = f.charset
    f.read
end

doc = Nokogiri::HTML(open(url), nil, "utf-8")
p doc.title
2
3
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3