# 分析网站 某一基金历史净值下的网页
# 003096下第二页的网址
# 请求 URL: http://api.fund.eastmoney.com/f10/lsjz?callback=jQuery18306109215334887248_1650275960949&fundCode=003096&pageIndex=2&pageSize=20&startDate=&endDate=&_=1650275974990
# 第三页
# 请求 URL: http://api.fund.eastmoney.com/f10/lsjz?callback=jQuery18306109215334887248_1650275960949&fundCode=003096&pageIndex=3&pageSize=20&startDate=&endDate=&_=1650276020380
# 分析得知pageIndex=2,pageIndex=3 有区别,其余都一样
# 修改处:13、36、39、58
import requests
import pandas as pd
import re
import json
import time
import random
def get_data(name,code,page=100): # 修改处(page是爬取某一基金的页数)
df_list =[] # 定义一个容器,将每页数据合并到一个表中
for index in range(1,page): # 某一基金爬取多少页
url = 'http://api.fund.eastmoney.com/f10/lsjz?callback=jQuery18306109215334887248_1650275960949&fundCod
基金排行榜中的基金净值
最新推荐文章于 2024-07-30 21:09:58 发布