【Python教程】利用python实时刷新基金估值效果(摸鱼小工具)

所需工具:

Python

聪明的大脑

勤劳的双手

 

注意:本站只提供教程,不提供任何成品+工具+软件链接,仅限用于学习和研究。

 

教程如下:

源码

import requests
import json
import os
from prettytable import PrettyTable
import time

fundlist = [‘163817′,’161017′,’003860’]

def GetFundJsonInfo(fundcode):
url = “http://fundgz.1234567.com.cn/js/”+fundcode+”.js”
response = requests.get(url)
fundDataInfo = response.text.split(‘({‘)[1]
fundDataInfo = ‘{‘+ fundDataInfo.split(‘})’)[0] + ‘}’
fundDataInfo = json.loads(fundDataInfo)
return fundDataInfo

温馨提示: 此处内容需要评论本文后才能查看.

标签

发表评论