import requests
class Details(object):
def __init__(self):
pass
def get(self,code):
url="http://qt.gtimg.cn/q=%s"%code
result=requests.get(url)
details=result.text.split(‘"‘)[1].split("~")
# 未知、名字、代码、当前价格、昨收、今开、成交量(手)、外盘、内盘、 =买一、买一量(手)、买二
# 买五、卖一、卖一量、卖二
# 卖五、最近逐笔成交、时间、涨跌、涨跌 %、最高、最低、价格 / 成交量(手) / 成交额
# 成交量(手)、成交额(万)、换手率、市盈率、最高、最低、振幅、流通市值、总市值、市净率、涨停价、跌停价
# [‘v_sz000858="51‘, ‘五 粮 液‘, ‘000858‘, ‘86.05‘, ‘84.90‘, ‘84.55‘, ‘287228‘, ‘156287‘, ‘130735‘, ‘86.04‘, ‘143‘,
# ‘86.03‘, ‘220‘, ‘86.02‘, ‘109‘, ‘86.01‘, ‘110‘, ‘86.00‘, ‘786‘, ‘86.05‘, ‘9‘, ‘86.06‘, ‘53‘, ‘86.07‘, ‘42‘,
# ‘86.08‘, ‘44‘, ‘86.09‘, ‘49‘,
# ‘15:00:04/86.05/3798/S/32681790/10175|14:57:00/85.99/8/B/68786/10079|14:56:57/85.98/44/S/378312/10077|14:56:54/85.97/87/S/748071/10075|14:56:51/85.98/63/B/541662/10073|14:56:48/85.98/69/B/593268/10071‘,
# ‘20190322153003‘, ‘1.15‘, ‘1.35‘, ‘86.62‘, ‘84.01‘, ‘86.05/287228/2459037963‘, ‘287228‘, ‘245904‘, ‘0.76‘,
# ‘27.37‘, ‘‘, ‘86.62‘, ‘84.01‘, ‘3.07‘, ‘3266.26‘, ‘3340.12‘, ‘5.60‘, ‘93.39‘, ‘76.41‘, ‘0.59‘, ‘1171‘, ‘85.62‘,
# ‘26.38‘, ‘34.53‘]
print(details)
if __name__=="__main__":
Details().get("sz000858")
原文:https://www.cnblogs.com/Zeech-Lee/p/11774535.html