当前位置: 首页 > news >正文

四川手机网站设计深圳网络营销方法

四川手机网站设计,深圳网络营销方法,网站加密,哪些网站是django做的雪球网行情中心网址#xff1a;https://xueqiu.com/hq 目标#xff1a;市场一览板块、热股榜板块、新股预告板块、关注排行榜板块 源代码如下#xff1a; import datetimeimport requestsheaders {user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKi… 雪球网行情中心网址https://xueqiu.com/hq 目标市场一览板块、热股榜板块、新股预告板块、关注排行榜板块 源代码如下 import datetimeimport requestsheaders  {user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36,}# 实例化session对象进行会话保持 session  requests.Session() url  https://xueqiu.com session.get(url, headersheaders)# 时间戳转成日期的函数 def timestamp_to_date(timestamp_data):timestamp  timestamp_data# 使用datetime.fromtimestamp()方法将时间戳转换为datetime对象datetime_obj  datetime.datetime.fromtimestamp(timestamp)# 使用strftime()方法将datetime对象格式化为字符串表示的日期formatted_date  datetime_obj.strftime(%Y-%m-%d)return formatted_date# 获取四大板块的指数 def get_four_index():url  https://stock.xueqiu.com/v5/stock/batch/quote.json?symbolSH000001,SZ399001,SZ399006,SH000688res  session.get(url, headersheaders)items_lst  res.json()[data][items]print(市 场 一 览)print()print(板块名称\t指 数\t涨跌幅\t\t\t总市值)for item in items_lst:data_dic  item[quote]print(data_dic[name], data_dic[current], str(data_dic[chg])  (  str(data_dic[percent])  )\t\t,f{data_dic[market_capital] / 1000000000000: .2f}万亿)print(-  * 50)def get_stock(url_dict):for stock_type in url_lst_dict.keys():res  session.get(url_dict[stock_type], headersheaders)res.encoding  res.apparent_encodingstock_data  res.json()print(f热股榜——{stock_type}\n)print(股票代码\t\t, 股票名称\t\t\t\t\t, 股票涨跌幅)for stock in stock_data[data][items]:print(f{stock[code]:8}\t, f{stock[name]:25}, f{stock[percent]:8})print(-  * 30)# 定义获取新股json函数 def get_json(new_stock_url):res  session.get(new_stock_url, headersheaders)new_stock  res.json()return new_stock# 定义获取港股新股函数 def hk_new_stokc(hk_new_stock_url):new_stock  get_json(hk_new_stock_url)print(-  * 40)print(港股)print(新股代码\t, 新股名称\t, 上市日期\t, 招股价下限\t, 招股价上限)new_stock_info  new_stock[data][items]for new_stock_item in new_stock_info:# 上市日期时间戳list_timestamp  new_stock_item[list_date] / 1000print(new_stock_item[symbol], \t, new_stock_item[name], \t, timestamp_to_date(list_timestamp), \t,new_stock_item[issprice_min], \t, new_stock_item[issprice_max])# 定义沪深新股抓取函数 def hs_new_stock(hs_new_stock_url):new_stock  get_json(hs_new_stock_url)print(新 股 预 告)print(-  * 40)print(沪深)print(新股发行数量, new_stock[data][count])print(新股代码\t, 新股名称\t, 申购代码\t, 预计发行量万股\t, 申购上限万股\t, 申购日期\t, 中签号公布日)new_stock_info  new_stock[data][items]for new_stock_item in new_stock_info:# 申购日期时间戳distr_timestamp  new_stock_item[onl_distr_date] / 1000# 公布中签日期时间戳draw_timestamp  new_stock_item[onl_lotwiner_stpub_date] / 1000print(new_stock_item[symbol], new_stock_item[name], \t, new_stock_item[onl_subcode], \t,new_stock_item[actissqty], \t\t\t, new_stock_item[onl_sub_maxqty], \t\t,timestamp_to_date(distr_timestamp), \t, timestamp_to_date(draw_timestamp))# 定义美股新股抓取函数 def un_new_stock(un_new_stock_url):new_stock  get_json(un_new_stock_url)print(-  * 50)print(美股)print(新股发行数量, new_stock[data][count])print(新股代码\t, 新股名称\t, 上市日期\t, \t股本, \t招股价下限\t, 招股价上限)new_stock_info  new_stock[data][items]for new_stock_item in new_stock_info:# 上市日期时间戳list_timestamp  new_stock_item[list_date] / 1000if new_stock_item[shares]:new_shares  \t  str(new_stock_item[shares] / 10000)  万else:new_shares  \t\t-\tif new_stock_item[issprice_min]:new_min  \t  str(new_stock_item[issprice_min])  \tif new_stock_item[issprice_max]:new_max  \t  str(new_stock_item[issprice_max])  \telse:new_max  \t-new_min  \t-\tprint(new_stock_item[symbol], \t, new_stock_item[name][:8], \t, timestamp_to_date(list_timestamp),new_shares, new_min, new_max)# 本周排行榜 本周新增股票最热门股票 def get_new_add_stock(new_add_url):new_add_stock  get_json(new_add_url)print(-  * 50)print(关注排行榜——本周新增)new_list  new_add_stock[data][list]print(股票名称\t\t股 价\t\t关 注)for add_stock in new_list:print(f{add_stock[name]}\t\t{add_stock[current]}\t\t{int(add_stock[follow7d]):})# 本周排行榜最热门股票 def get_hot_stock(new_hot_url):hot_stock  get_json(new_hot_url)print(-  * 50)print(关注排行榜——最热门)hot_lst  hot_stock[data][list]print(股票名称\t\t股 价\t\t关 注)for hot_stock in hot_lst:print(f{hot_stock[name]}\t\t{hot_stock[current]}\t\t{int(hot_stock[follow]):})if __name__  __main__:# 四大板块信息get_four_index()# 热门股票url_lst_dict  {沪深: https://stock.xueqiu.com/v5/stock/hot_stock/list.json?page1size9_type12type12,港股: https://stock.xueqiu.com/v5/stock/hot_stock/list.json?page1size9_type13type13,美股: https://stock.xueqiu.com/v5/stock/hot_stock/list.json?page1size9_type11type11}get_stock(url_lst_dict)print()# 沪深新股网址hs_new_stock_url  https://stock.xueqiu.com/v5/stock/preipo/cn/query.json?typesubscribeorder_byonl_subbeg_dateorderascsourcenew_subscribepage1size10hs_new_stock(hs_new_stock_url)# 港股新股网址hk_new_stock_url  https://stock.xueqiu.com/v5/stock/preipo/hk/query.json?orderdescorder_bylist_datetypeunlistedpage1size10hk_new_stokc(hk_new_stock_url)# 美股新股网址un_new_stock_url  https://stock.xueqiu.com/v5/stock/preipo/us/list.json?orderdescorder_bylist_datetypeunlistedpage1size10un_new_stock(un_new_stock_url)# 关注排行榜本周新增new_add_stock_url  https://stock.xueqiu.com/v5/stock/screener/screen.json?page1only_count0size10categoryCNorder_byfollow7dorderdescget_new_add_stock(new_add_stock_url)# 最热门股票hot_stock_url  https://stock.xueqiu.com/v5/stock/screener/screen.json?page1only_count0size10categoryCNorder_byfolloworderdesc 本案例利用requests请求模块的知识请大家登录https://zglg.work或者通过下方【阅读原文】跳转体验在线编程的乐趣。
http://www.pierceye.com/news/758400/

相关文章:

  • 网页界面设计评分标准东营网站关键字优化
  • 手表网站背景素材玉山网站建设
  • 增城新塘网站建设温州网站推广效果
  • 东莞市住房建设局网站编程能干什么
  • asp做一个简单网站推广图片素材
  • 新网站一直不被收录wordpress 视频 广告
  • 网站建设费账务处理一个小胖子从网站做任务的网站故事
  • 国外被墙网站东营建设信息网最新消息
  • iphone下载网页视频北京百度seo排名公司
  • 怎么自己做网站免费的衡阳seo网站推广
  • 一键生成论文的网站做亚马逊有哪些网站可以清货
  • 一屏网站模板下载 迅雷下载 迅雷下载地址网站建设合并但与那个
  • 营销型网站四大功能吉林市网站制作
  • 如何制作钓鱼网站网页制作基础教程9787121095306教案
  • 专业定制网站企业吉林省住房城乡建设厅网站首页
  • 免费高清素材网站方维网络科技有限公司
  • 长春行业网站重庆智能建站模板
  • 北湖区网站建设公司wordpress的cute主题
  • 沈阳网站建设 景乔科技网站制作杭州
  • 网站维护工程师月薪多少精品网站建设公
  • 永久免费企业网站申请网站开发主框架一般用什么布局
  • 网站做非经营性广告需备案python免费看电影的应用
  • 网站分哪些种类自己做网站模版
  • 汪峰做的音乐网站长沙制作公园仿竹护栏实体厂家
  • 深圳专业网站建设公司排名好的h5网站模板
  • h5做网站教程网店营销的推广方法有哪些
  • 网站关键词快速排名工具wordpress子主题
  • 做百度网站那家好google 网站质量问题
  • 网站建设维护书网站资料清单
  • 网站建设公司 深圳信科网站维护计划