c672569644 发表于 2022-12-8 01:31

有没有大佬能帮忙搞个可以直接读取这里面数据的链接

本帖最后由 c672569644 于 2022-12-18 15:01 编辑


这是网址:http://fundf10.eastmoney.com/jjjz_515220.html
URL: http://api.fund.eastmoney.com/f10/lsjz?callback=jQuery18302175108203393441_1670434231065&fundCode=515220&pageIndex=1&pageSize=20&startDate=&endDate=&_=1670434231083

amoxuk 发表于 2022-12-8 01:51

curl 'http://api.fund.eastmoney.com/f10/lsjz?callback=jQuery183010089062411911098_1670435240926&fundCode=515220&pageIndex=1&pageSize=20&startDate=&endDate=&_=1670435240946' \
-H 'Accept: */*' \
-H 'Accept-Language: en-US,en-GB;q=0.9,en;q=0.8,zh-CN;q=0.7,zh;q=0.6' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Cookie: st_si=54807336210699; st_pvi=26977814806381; st_sp=2022-12-08%2001%3A47%3A10; st_inirUrl=; st_sn=1; st_psi=20221208014710756-112200305283-9124752620; st_asi=delete' \
-H 'Pragma: no-cache' \
-H 'Referer: http://fundf10.eastmoney.com/' \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.42' \
--compressed \
--insecure

叫我小白呀 发表于 2022-12-8 02:07

你自己不是写出来了吗,有个api接口

三滑稽甲苯 发表于 2022-12-8 07:40

你给的url就是api啊,加个请求头应该就可以了

mokjf 发表于 2022-12-8 08:37

推荐两只基金吧,让大家过年都能加个鸡腿

skl520 发表于 2022-12-8 08:49

同意楼上的

ReLoading 发表于 2022-12-8 10:16

wuming4 发表于 2022-12-8 10:22

我是来看热闹的,因为小白不懂

fuwenyue 发表于 2022-12-8 10:29

# -*- coding: utf-8 -*-
"""
Created on Thu Dec8 10:15:59 2022

@author: Administrator
"""

import requests,re,json

cookies = {
    'st_si': '25114671169170',
    'st_pvi': '57444998705878',
    'st_sp': '2022-12-08%2010%3A10%3A59',
    'st_inirUrl': '',
    'st_sn': '1',
    'st_psi': '20221208101059303-112200305283-0587948833',
    'st_asi': 'delete',
}

headers = {
    'Accept': '*/*',
    'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
    'Connection': 'keep-alive',
    # Requests sorts cookies= alphabetically
    # 'Cookie': 'st_si=25114671169170; st_pvi=57444998705878; st_sp=2022-12-08%2010%3A10%3A59; st_inirUrl=; st_sn=1; st_psi=20221208101059303-112200305283-0587948833; st_asi=delete',
    'DNT': '1',
    'Referer': 'http://fundf10.eastmoney.com/',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.42',
}

params = {
    'callback': 'jQuery183022672186565598262_1670465470319',
    'fundCode': '515220',
    'pageIndex': '1',
    'pageSize': '20',
    'startDate': '',
    'endDate': '',
    '_': '1670465470401',
}

response = requests.get('http://api.fund.eastmoney.com/f10/lsjz', params=params, cookies=cookies, headers=headers, verify=False)

data = re.findall('\((.*?)\)',response.text)

data = json.loads(data)

ALILEI1314 发表于 2022-12-8 10:45

我也同意6楼
页: [1] 2
查看完整版本: 有没有大佬能帮忙搞个可以直接读取这里面数据的链接