import requests
import json
def get_url(code="sz002142"):
url="https://qt.gtimg.cn/q="
return requests.get(url+code)
q=get_url()
#不分割
def parse_data(code_str):
rex={}
code_str = code_str.replace("~~~", "~").replace("~~", "~")
vsx=code_str.split("~")
if len(vsx)>10:
rex['name']=vsx[1]
rex['code']=vsx[2]
rex['now']=vsx[3]
rex['yestday']=vsx[4]
rex['today_start']=vsx[5]
rex['done_num']=vsx[6]
rex['done_money']=vsx[36]
rex['done_pre']=vsx[37]
rex['today_max']=vsx[32]
rex['today_min']=vsx[33]
rex['time']=vsx[29]
rex['preg']=vsx[37]
rex['syl']=vsx[38]
rex['money']=vsx[68]
rex['year_max']=vsx[45]
rex['year_min']=vsx[46]
return rex
def c_code(num):
#传入必须为之str 因为 sz为0开头
str_num=str(num)
if len(str_num)!=6:
return False
if str_num[0:1] in ['0','2','3']:
return "sz"+str_num
elif str_num[0:1] in ['6','9']:
return "sh"+str_num
elif str_num[0:1] in ['4','8']:
return "bj"+str_num
else:
return False
def c_search_str(num_list):
str_code=''
for i in num_list:
code=c_code(i)
if code:
str_code=code+","+str_code
return str_code
-
近期文章
近期评论
- admin 发表在《PDF文件分割图片》
- admin 发表在《混乱的五月即将告以段路》
- admin 发表在《系规看来不是300页那么简单》
- admin 发表在《系规看来不是300页那么简单》
- admin 发表在《扩展计划UserScript》
归档
- 2026 年 4 月
- 2026 年 3 月
- 2026 年 2 月
- 2026 年 1 月
- 2025 年 12 月
- 2025 年 11 月
- 2025 年 10 月
- 2025 年 9 月
- 2025 年 8 月
- 2025 年 7 月
- 2025 年 6 月
- 2025 年 5 月
- 2025 年 4 月
- 2025 年 3 月
- 2025 年 2 月
- 2025 年 1 月
- 2024 年 12 月
- 2024 年 11 月
- 2024 年 10 月
- 2024 年 9 月
- 2024 年 8 月
- 2024 年 7 月
- 2024 年 6 月
- 2024 年 5 月
- 2024 年 4 月
- 2024 年 2 月
- 2024 年 1 月
- 2023 年 12 月
- 2023 年 11 月
- 2023 年 10 月
- 2022 年 10 月
- 2022 年 9 月
- 2022 年 8 月
- 2022 年 7 月
- 2022 年 6 月
- 2022 年 5 月
- 2022 年 4 月
- 2022 年 3 月
- 2022 年 1 月
- 2021 年 11 月
- 2021 年 10 月
- 2021 年 9 月
- 2021 年 4 月
- 2020 年 11 月
- 2020 年 10 月
- 2020 年 8 月
- 2020 年 5 月
- 2020 年 4 月
- 2020 年 1 月
- 2019 年 11 月
- 2019 年 7 月
- 2019 年 2 月
- 2019 年 1 月
- 2018 年 12 月
- 2018 年 11 月
- 2018 年 8 月
分类
友情链接
其他操作