ijd8.COM

A simple blog for an old Ma Nong.

从天天基金网站获取历史净值

Permalink

获取某个基金的历史净值,这里是通过天天基金的相关接口合理爬取。

  1. 查询某个基金的相关信息

    http://fund.eastmoney.com/001938.html?spm=search
    

    其中的001938为基金的代码

  2. 查询基金的历史净值页面

    http://fundf10.eastmoney.com/jjjz_001938.html
    

    其中的001938为基金的代码

  3. 查询基金历史净值数据接口

    http://api.fund.eastmoney.com/f10/lsjz?callback=jQuery18304038998523093684_1586160530315&fundCode=基金代码&pageIndex=页数&pageSize=每页数据条数
    

    由于反爬措施,访问需要携带请求头:Referer,它的值如下

    http://fundf10.eastmoney.com/jjjz_基金代码.html
    

出处 https://github.com/EthanYan6/Tiantian-Fund-Spider

Write a Comment

Submit Comment Login
Based on Golang + fastHTTP + sdb | go1.16.7 Processed in 3ms