Last active
August 29, 2015 14:14
-
-
Save smallfield/19146f54b09e4b65c807 to your computer and use it in GitHub Desktop.
野村Net&Callで投資信託毎の投資来利益をTSVで出力する
This file contains 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 "mechanize" | |
ID="" | |
PASSWD="" | |
agt = Mechanize.new | |
agt.user_agent_alias = "Windows IE 9" | |
page = agt.get("https://netcall.nomura.co.jp/oms") | |
form = page.forms[0] | |
form.user_id = ID | |
form.user_password = PASSWD | |
page = agt.submit(form) | |
page = agt.get("https://netcall.nomura.co.jp/oms/BlcLstControl") | |
page.search("//*[@id=\"complexTable6\"]/tbody/tr").each do |tr| | |
col = [] | |
col << tr.search("td[1]/span").text.gsub(/[\[\]]/,"") | |
col << tr.search("td[7]/span[2]/span").text.gsub(/[\+,]/, "") | |
puts col.join "\t" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment