Last active
December 17, 2015 14:59
-
-
Save yesmeck/5628912 to your computer and use it in GitHub Desktop.
Stock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'nokogiri' | |
code = 2904 | |
doc = Nokogiri::HTML(open("http://just2.entrust.com.tw/z/zc/zca/zca_#{code}.djhtm")) | |
# 當前股價,既網頁中的收盤價 | |
doc.css('table')[2].css('tr')[1].css('td').last.inner_text.to_f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment