Jiangtang's profile技止于此BlogListsNetwork Tools Help

Blog


    8/5/2007

    下载yahoo finance和雅虎财经数据

    找股票、基金、期货等实时或历史数据,yahoo finance是一个不错的地方(最好的地方?),更新快,免费,输出格式通用。如果你只想要比如ibm股票的数据,那直接下载就是;但如果想用爬虫程序同时下载ibm、google等数十家股票的数据——气人的是——所有的下载过来的数据都以table.csv命名,想想还是用迅雷加手动省事:

    • 打开yahoo finance主页http://finance.yahoo.com/,左上角有个“Enter Symbol(s)”的提示框,填入你想要股票代码,比如ibm。如果没有直接对应的股票,比如你输入google,它就会转到一个搜索界面,再选中goog便是;
    • 前面我们填的是ibm,那么我们就进入了http://finance.yahoo.com/q?s=ibm这个页面。在页面的左栏,“Quotes”栏目的第三个,点击"Historical Prices"就进入了ibm股票的历史数据页面http://finance.yahoo.com/q/hp?s=IBM
    • 在这个数据页面,你还可以设定你需要数据的时间刻度(日交易数据还是周、月交易数据)和时间范围(在事件研究项目上有用),默认的时间刻度是天,范围是最早到最近。拉到页面的最低端,找到“Download To Spreadsheet”这个按钮。如果你只需要这个数据,点击保存就是。要注意的是所有下载下来的数据都以table.csv命名,所以一定记得要重命名;
    • 如果想利用迅雷同是下载更多只股票的信息,那么我们就要看看以上链接的信息。比如在ibm的页面,在那个“Download To Spreadsheet”上,点右键,找到“Properties性质”,我们看到这个数据文件的URL是

      http://ichart.finance.yahoo.com/table.csv?s=IBM&d=7&e=5&f=2007&g=d&a=0&b=2&c=1962&ignore=.csv,同样查到google股票数据的URL是

    http://ichart.finance.yahoo.com/table.csv?s=GOOG&d=7&e=5&f=2007&g=d&a=7&b=19&c=2004&ignore=.csv

    • 以上差别就是加黑部分股票代码的不同。比如说我们还知道其他感兴趣的股票代码,比如ag等,现在就可以打开迅雷,点“文件”—“新建”,在弹出来的对话框中,“网址(URL)”就填入http://ichart.finance.yahoo.com/table.csv?s=IBM&d=7&e=5&f=2007&g=d&a=0&b=2&c=1962&ignore=.csv并命名为ibm.csv;对ag等股票,把上面的URL中的IBM改为AG就是,接下来重复以上动作,填上所有你感兴趣的股票代码,剩下的就是让机器慢慢下了。

    当然,以上手工活还挺多。听说有个专门下yahoo finance的工具,不知其可。中国雅虎的财经频道跟yahoo finance类似的结构,一样可行。

    Comments (3)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    No namewrote:
    您需要二手液晶显示屏废旧液晶屏么?我们是不折不扣的二手液晶屏、旧液晶屏大批发商,长期大量供应可再利用的旧液晶屏。我公司提供的各种尺寸的二手液晶屏, 不同厚薄如笔记本屏,均已经过我们严格的分类,检验,测试流程。请访问协力液晶屏www.sceondhandlcd.com[ghfadiijghbjcha]
    Nov. 21
    Nov. 9
    Nov. 3

    Trackbacks

    The trackback URL for this entry is:
    http://johnthu.spaces.live.com/blog/cns!2053CD511E6D5B1E!257.trak
    Weblogs that reference this entry
    • None