Created
August 25, 2013 08:18
-
-
Save choro3/6332637 to your computer and use it in GitHub Desktop.
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
| # coding: utf-8 | |
| """ | |
| Yahooファイナンスからトルコリラ/円の為替レートを取得するだけ | |
| """ | |
| import sys | |
| import argparse | |
| import urllib | |
| from pyquery import PyQuery as pq | |
| def fetch_turjpy(): | |
| res = urllib.urlopen('http://stocks.finance.yahoo.co.jp/stocks/detail/?code=TRYJPY=X') | |
| d = pq(res.read()) | |
| return [e.text for e in d('.ymuiEditLink.mar0 strong')] | |
| def main(): | |
| bid, ask = fetch_turjpy() | |
| print bid, ask | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment