Python编程的例子----股票数据接口
本人是以C++為主的開發,Python只是我的玩具語言,對它我沒有特別深入的了解,但是,由于Python符合一般的語言設計原則,所以,學起這個語言會比較輕松,另外,我的這篇博客使用了一些開發技巧,比如生產者消費者模型(其實完全沒有必要這么做,如果你感興趣另外一種簡單的方式,可以給我留言)!!!正則表達式的使用,我不認為我的這個是最好的,因為我并不擅長這個!下面是主要的內容:
如果你要同時查詢多個股票,那么在URL最后加上一個逗號,再加上股票代碼就可以了;比如你要一次查詢大秦鐵路(601006)和大同煤業(601001)的行情,就這樣使用URL:
http://hq.sinajs.cn/list=sh601003,sh601001
查詢大盤指數,比如查詢上證綜合指數(000001):
http://hq.sinajs.cn/list=s_sh000001
歷史接口
http://money.finance.sina.com.cn/corp/go.php/vMS_MarketHistory/stockid/603299.phtml?year=2015&jidu=4
獲取代碼表
上海證券交易所
http://www.sse.com.cn/
上市公司代碼列表
http://www.sse.com.cn/assortment/stock/list/name/
信息披露
http://www.sse.com.cn/disclosure/
深圳證券交易所
http://www.szse.cn/
股票交易品種
http://www.szse.cn/main/marketdata/jypz/colist/
信息披露
http://www.szse.cn/main/disclosure/
獲取股票編碼,使用python 3
元組中第一個元素代表“股票代碼”,第二個元素代表“股票名稱”,第三個元素代表“股票拼音簡寫”
得到最近10個季度的歷史數據
#!/usr/bin/python3 #-*-coding:utf-8-*-import requests from bs4 import BeautifulSoup import re import time import threading import sys# 1. get list about product # headers_str = '''Host: www.sse.com.cn # User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 # Referer: http://www.sse.com.cn/assortment/ # ''' # headers_list = re.findall(r'(.*?):(.*)', headers_str) # headers = {} # for item in headers_list: # headers[item[0]] = item[1] # # url = 'http://www.sse.com.cn/js/common/ssesuggestdata.js;pv330c5904dbd20445' # print(url) # js = requests.get(url=url, headers=headers) # js.encoding = js.apparent_encoding # list_product = re.findall(r'val:\"(.*?)\".*?val2:\"(.*?)\".*?val3:\"(.*?)\"', js.text, re.S) list_product = [('600000', '浦發銀行', 'pfyx'),('600004', '白云機場', 'byjc'),('600005', '武鋼股份', 'wggf'),('600006', '東風汽車', 'dfqc'),('600007', '中國國貿', 'zggm'),('600008', '首創股份', 'scgf'),('600009', '上海機場', 'shjc'),('600010', '包鋼股份', 'bggf'),('600011', '華能國際', 'hngj'),('600012', '皖通高速', 'wtgs'),('600015', '華夏銀行', 'hxyx'),('600016', '民生銀行', 'msyx'),('600017', '日照港', 'rzg'),('600018', '上港集團', 'sgjt'),('600019', '寶鋼股份', 'bggf'),('600020', '中原高速', 'zygs'),('600021', '上海電力', 'shdl'),('600022', '山東鋼鐵', 'sdgt'),('600023', '浙能電力', 'zndl'),('600026', '中海發展', 'zhfz'),('600027', '華電國際', 'hdgj'),('600028', '中國石化', 'zgsh'),('600029', '南方航空', 'nfhk'),('600030', '中信證券', 'zxzq'),('600031', '三一重工', 'syzg'),('600033', '福建高速', 'fjgs'),('600035', '楚天高速', 'ctgs'),('600036', '招商銀行', 'zsyx'),('600037', '歌華有線', 'ghyx'),('600038', '中直股份', 'zzgf'),('600039', '四川路橋', 'sclq'),('600048', '保利地產', 'bldc'),('600050', '中國聯通', 'zglt'),('600051', '寧波聯合', 'nblh'),('600052', '浙江廣廈', 'zjgs'),('600053', '九鼎投資', 'jdtz'),('600054', '黃山旅游', 'hsly'),('600055', '華潤萬東', 'hrwd'),('600056', '中國醫藥', 'zgyy'),('600057', '象嶼股份', 'xygf'),('600058', '五礦發展', 'wkfz'),('600059', '古越龍山', 'gyls'),('600060', '海信電器', 'hxdq'),('600061', '國投安信', 'gtax'),('600062', '華潤雙鶴', 'hrsh'),('600063', '皖維高新', 'wwgx'),('600064', '南京高科', 'njgk'),('600066', '宇通客車', 'ytkc'),('600067', '冠城大通', 'gcdt'),('600068', '葛洲壩', 'gzb'),('600069', '*ST銀鴿', '*STyg'),('600070', '浙江富潤', 'zjfr'),('600071', '*ST光學', '*STgx'),('600072', '鋼構工程', 'gggc'),('600073', '上海梅林', 'shml'),('600074', '保千里', 'bql'),('600075', '新疆天業', 'xjty'),('600076', '青鳥華光', 'qnhg'),('600077', '宋都股份', 'sdgf'),('600078', '澄星股份', 'cxgf'),('600079', '人福醫藥', 'rfyy'),('600080', '金花股份', 'jhgf'),('600081', '東風科技', 'dfkj'),('600082', '海泰發展', 'htfz'),('600083', '博信股份', 'bxgf'),('600084', '中葡股份', 'zpgf'),('600085', '同仁堂', 'trt'),('600086', '東方金鈺', 'dfjy'),('600088', '中視傳媒', 'zscm'),('600089', '特變電工', 'tbdg'),('600090', '啤酒花', 'pjh'),('600091', '*ST明科', '*STmk'),('600093', '禾嘉股份', 'hjgf'),('600094', '大名城', 'dmc'),('600095', '哈高科', 'hgk'),('600096', '云天化', 'yth'),('600097', '開創國際', 'kcgj'),('600098', '廣州發展', 'gzfz'),('600099', '林海股份', 'lhgf'),('600100', '同方股份', 'tfgf'),('600101', '明星電力', 'mxdl'),('600103', '青山紙業', 'qszy'),('600104', '上汽集團', 'sqjt'),('600105', '永鼎股份', 'ydgf'),('600106', '重慶路橋', 'zqlq'),('600107', '美爾雅', 'mey'),('600108', '亞盛集團', 'ysjt'),('600109', '國金證券', 'gjzq'),('600110', '中科英華', 'zkyh'),('600111', '北方稀土', 'bfxt'),('600112', '天成控股', 'tckg'),('600113', '浙江東日', 'zjdr'),('600114', '東睦股份', 'dmgf'),('600115', '東方航空', 'dfhk'),('600116', '三峽水利', 'sxsl'),('600117', '西寧特鋼', 'xntg'),('600118', '中國衛星', 'zgwx'),('600119', '長江投資', 'zjtz'),('600120', '浙江東方', 'zjdf'),('600121', '鄭州煤電', 'zzmd'),('600122', '宏圖高科', 'htgk'),('600123', '蘭花科創', 'lhkc'),('600125', '鐵龍物流', 'tlwl'),('600126', '杭鋼股份', 'hggf'),('600127', '金健米業', 'jjmy'),('600128', '弘業股份', 'hygf'),('600129', '太極集團', 'tjjt'),('600130', '波導股份', 'bdgf'),('600131', '岷江水電', 'mjsd'),('600132', '重慶啤酒', 'zqpj'),('600133', '東湖高新', 'dhgx'),('600135', '樂凱膠片', 'lkjp'),('600136', '道博股份', 'dbgf'),('600137', '浪莎股份', 'lsgf'),('600138', '中青旅', 'zql'),('600139', '西部資源', 'xbzy'),('600141', '興發集團', 'xfjt'),('600143', '金發科技', 'jfkj'),('600145', '*ST新億', '*STxy'),('600146', '商贏環球', 'syhq'),('600148', '長春一東', 'zcyd'),('600149', '廊坊發展', 'lffz'),('600150', '中國船舶', 'zgcb'),('600151', '航天機電', 'htjd'),('600152', '維科精華', 'wkjh'),('600153', '建發股份', 'jfgf'),('600155', '寶碩股份', 'bsgf'),('600156', '華升股份', 'hsgf'),('600157', '永泰能源', 'ytny'),('600158', '中體產業', 'ztcy'),('600159', '大龍地產', 'dldc'),('600160', '巨化股份', 'jhgf'),('600161', '天壇生物', 'ttsw'),('600162', '香江控股', 'xjkg'),('600163', '*ST閩能', '*STmn'),('600165', '新日恒力', 'xrhl'),('600166', '福田汽車', 'ftqc'),('600167', '聯美控股', 'lmkg'),('600168', '武漢控股', 'whkg'),('600169', '太原重工', 'tyzg'),('600170', '上海建工', 'shjg'),('600171', '上海貝嶺', 'shbl'),('600172', '黃河旋風', 'hhxf'),('600173', '臥龍地產', 'wldc'),('600175', '美都能源', 'mdny'),('600176', '中國巨石', 'zgjs'),('600177', '雅戈爾', 'yge'),('600178', '東安動力', 'dadl'),('600179', '黑化股份', 'hhgf'),('600180', '瑞茂通', 'rmt'),('600182', 'S佳通', 'Sjt'),('600183', '生益科技', 'sykj'),('600184', '光電股份', 'gdgf'),('600185', '格力地產', 'gldc'),('600186', '蓮花味精', 'lhwj'),('600187', '國中水務', 'gzsw'),('600188', '兗州煤業', 'yzmy'),('600189', '吉林森工', 'jlsg'),('600190', '錦州港', 'jzg'),('600191', '華資實業', 'hzsy'),('600192', '長城電工', 'zcdg'),('600193', '創興資源', 'cxzy'),('600195', '中牧股份', 'zmgf'),('600196', '復星醫藥', 'fxyy'),('600197', '伊力特', 'ylt'),('600198', '大唐電信', 'dtdx'),('600199', '金種子酒', 'jzzj'),('600200', '江蘇吳中', 'jswz'),('600201', '生物股份', 'swgf'),('600202', '哈空調', 'hkd'),('600203', '福日電子', 'frdz'),('600206', '有研新材', 'yyxc'),('600207', '安彩高科', 'acgk'),('600208', '新湖中寶', 'xhzb'),('600209', '羅頓發展', 'ldfz'),('600210', '紫江企業', 'zjqy'),('600211', '西藏藥業', 'xzyy'),('600212', '江泉實業', 'jqsy'),('600213', '亞星客車', 'yxkc'),('600215', '長春經開', 'zcjk'),('600216', '浙江醫藥', 'zjyy'),('600217', '*ST秦嶺', '*STql'),('600218', '全柴動力', 'qcdl'),('600219', '南山鋁業', 'nsly'),('600220', '江蘇陽光', 'jsyg'),('600221', '海南航空', 'hnhk'),('600222', '太龍藥業', 'tlyy'),('600223', '魯商置業', 'lszy'),('600225', '天津松江', 'tjsj'),('600226', '升華拜克', 'shbk'),('600227', '赤天化', 'cth'),('600228', '昌九生化', 'cjsh'),('600229', '城市傳媒', 'cscm'),('600230', '滄州大化', 'czdh'),('600231', '凌鋼股份', 'lggf'),('600232', '金鷹股份', 'jygf'),('600233', '大楊創世', 'dycs'),('600234', '山水文化', 'sswh'),('600235', '民豐特紙', 'mftz'),('600236', '桂冠電力', 'ggdl'),('600237', '銅峰電子', 'tfdz'),('600238', '海南椰島', 'hnyd'),('600239', '云南城投', 'ynct'),('600240', '華業資本', 'hyzb'),('600241', '時代萬恒', 'sdwh'),('600242', '*ST中昌', '*STzc'),('600243', '青海華鼎', 'qhhd'),('600246', '萬通地產', 'wtdc'),('600247', '*ST成城', '*STcc'),('600248', '延長化建', 'yzhj'),('600249', '兩面針', 'lmz'),('600250', '南紡股份', 'nfgf'),('600251', '冠農股份', 'gngf'),('600252', '中恒集團', 'zhjt'),('600255', '鑫科材料', 'xkcl'),('600256', '廣匯能源', 'ghny'),('600257', '大湖股份', 'dhgf'),('600258', '首旅酒店', 'sljd'),('600259', '廣晟有色', 'gsys'),('600260', '凱樂科技', 'klkj'),('600261', '陽光照明', 'ygzm'),('600262', '北方股份', 'bfgf'),('600265', 'ST景谷', 'STjg'),('600266', '北京城建', 'bjcj'),('600267', '海正藥業', 'hzyy'),('600268', '國電南自', 'gdnz'),('600269', '贛粵高速', 'gygs'),('600270', '外運發展', 'wyfz'),('600271', '航天信息', 'htxx'),('600272', '開開實業', 'kksy'),('600273', '嘉化能源', 'jhny'),('600275', '武昌魚', 'wcy'),('600276', '恒瑞醫藥', 'hryy'),('600277', '億利潔能', 'yljn'),('600278', '東方創業', 'dfcy'),('600279', '重慶港九', 'zqgj'),('600280', '中央商場', 'zysc'),('600281', '太化股份', 'thgf'),('600282', '南鋼股份', 'nggf'),('600283', '錢江水利', 'qjsl'),('600284', '浦東建設', 'pdjs'),('600285', '羚銳制藥', 'lrzy'),('600287', '江蘇舜天', 'jsst'),('600288', '大恒科技', 'dhkj'),('600289', '億陽信通', 'yyxt'),('600290', '華儀電氣', 'hydq'),('600291', '西水股份', 'xsgf'),('600292', '中電遠達', 'zdyd'),('600293', '三峽新材', 'sxxc'),('600295', '鄂爾多斯', 'eeds'),('600297', '廣匯汽車', 'ghqc'),('600298', '安琪酵母', 'aqjm'),('600299', '安迪蘇', 'ads'),('600300', '維維股份', 'wwgf'),('600301', '*ST南化', '*STnh'),('600302', '標準股份', 'bzgf'),('600303', '曙光股份', 'sggf'),('600305', '恒順醋業', 'hscy'),('600306', '商業城', 'syc'),('600307', '酒鋼宏興', 'jghx'),('600308', '華泰股份', 'htgf'),('600309', '萬華化學', 'whhx'),('600310', '桂東電力', 'gddl'),('600311', 'ST榮華', 'STrh'),('600312', '平高電氣', 'pgdq'),('600313', '農發種業', 'nfzy'),('600315', '上海家化', 'shjh'),('600316', '洪都航空', 'hdhk'),('600317', '營口港', 'ykg'),('600318', '巢東股份', 'cdgf'),('600319', '亞星化學', 'yxhx'),('600320', '振華重工', 'zhzg'),('600321', '國棟建設', 'gdjs'),('600322', '天房發展', 'tffz'),('600323', '瀚藍環境', 'hlhj'),('600325', '華發股份', 'hfgf'),('600326', '西藏天路', 'xztl'),('600327', '大東方', 'ddf'),('600328', '蘭太實業', 'ltsy'),('600329', '中新藥業', 'zxyy'),('600330', '天通股份', 'ttgf'),('600331', '宏達股份', 'hdgf'),('600332', '白云山', 'bys'),('600333', '長春燃氣', 'zcrq'),('600335', '國機汽車', 'gjqc'),('600336', '澳柯瑪', 'akm'),('600337', '美克家居', 'mkjj'),('600338', '西藏珠峰', 'xzzf'),('600339', '天利高新', 'tlgx'),('600340', '華夏幸福', 'hxxf'),('600343', '航天動力', 'htdl'),('600345', '長江通信', 'zjtx'),('600346', '大橡塑', 'dxs'),('600348', '陽泉煤業', 'yqmy'),('600350', '山東高速', 'sdgs'),('600351', '亞寶藥業', 'ybyy'),('600352', '浙江龍盛', 'zjls'),('600353', '旭光股份', 'xggf'),('600354', '敦煌種業', 'dhzy'),('600355', '精倫電子', 'jldz'),('600356', '恒豐紙業', 'hfzy'),('600358', '國旅聯合', 'gllh'),('600359', '新農開發', 'xnkf'),('600360', '華微電子', 'hwdz'),('600361', '華聯綜超', 'hlzc'),('600362', '江西銅業', 'jxty'),('600363', '聯創光電', 'lcgd'),('600365', '通葡股份', 'tpgf'),('600366', '寧波韻升', 'nbys'),('600367', '紅星發展', 'hxfz'),('600368', '五洲交通', 'wzjt'),('600369', '西南證券', 'xnzq'),('600370', '三房巷', 'sfx'),('600371', '萬向德農', 'wxdn'),('600372', '中航電子', 'zhdz'),('600373', '中文傳媒', 'zwcm'),('600375', '華菱星馬', 'hlxm'),('600376', '首開股份', 'skgf'),('600377', '寧滬高速', 'nhgs'),('600378', '天科股份', 'tkgf'),('600379', '寶光股份', 'bggf'),('600380', '健康元', 'jky'),('600381', '青海春天', 'qhct'),('600382', '廣東明珠', 'gdmz'),('600383', '金地集團', 'jdjt'),('600385', '山東金泰', 'sdjt'),('600386', '北巴傳媒', 'bbcm'),('600387', '海越股份', 'hygf'),('600388', '龍凈環保', 'ljhb'),('600389', '江山股份', 'jsgf'),('600390', '金瑞科技', 'jrkj'),('600391', '成發科技', 'cfkj'),('600392', '盛和資源', 'shzy'),('600393', '東華實業', 'dhsy'),('600395', '盤江股份', 'pjgf'),('600396', '金山股份', 'jsgf'),('600397', '安源煤業', 'aymy'),('600398', '海瀾之家', 'hlzj'),('600399', '撫順特鋼', 'fstg'),('600400', '紅豆股份', 'hdgf'),('600401', '*ST海潤', '*SThr'),('600403', '大有能源', 'dyny'),('600405', '動力源', 'dly'),('600406', '國電南瑞', 'gdnr'),('600408', '*ST安泰', '*STat'),('600409', '三友化工', 'syhg'),('600410', '華勝天成', 'hstc'),('600415', '小商品城', 'xspc'),('600416', '湘電股份', 'xdgf'),('600418', '江淮汽車', 'jhqc'),('600419', '天潤乳業', 'trry'),('600420', '現代制藥', 'xdzy'),('600421', '仰帆控股', 'yfkg'),('600422', '昆藥集團', 'kyjt'),('600423', '柳化股份', 'lhgf'),('600425', '青松建化', 'qsjh'),('600426', '華魯恒升', 'hlhs'),('600428', '中遠航運', 'zyhy'),('600429', '三元股份', 'sygf'),('600432', '吉恩鎳業', 'jeny'),('600433', '冠豪高新', 'ghgx'),('600435', '北方導航', 'bfdh'),('600436', '片仔癀', 'pzh'),('600438', '通威股份', 'twgf'),('600439', '瑞貝卡', 'rbk'),('600444', '*ST國通', '*STgt'),('600446', '金證股份', 'jzgf'),('600448', '華紡股份', 'hfgf'),('600449', '寧夏建材', 'nxjc'),('600452', '涪陵電力', 'fldl'),('600455', '博通股份', 'btgf'),('600456', '寶鈦股份', 'btgf'),('600458', '時代新材', 'sdxc'),('600459', '貴研鉑業', 'gyby'),('600460', '士蘭微', 'slw'),('600461', '洪城水業', 'hcsy'),('600462', '石峴紙業', 'sxzy'),('600463', '空港股份', 'kggf'),('600466', '藍光發展', 'lgfz'),('600467', '好當家', 'hdj'),('600468', '百利電氣', 'bldq'),('600469', '風神股份', 'fsgf'),('600470', '六國化工', 'lghg'),('600475', '華光股份', 'hggf'),('600476', '湘郵科技', 'xykj'),('600477', '杭蕭鋼構', 'hxgg'),('600478', '科力遠', 'kly'),('600479', '千金藥業', 'qjyy'),('600480', '凌云股份', 'lygf'),('600481', '雙良節能', 'sljn'),('600482', '風帆股份', 'ffgf'),('600483', '福能股份', 'fngf'),('600485', '信威集團', 'xwjt'),('600486', '揚農化工', 'ynhg'),('600487', '亨通光電', 'htgd'),('600488', '天藥股份', 'tygf'),('600489', '中金黃金', 'zjhj'),('600490', '鵬欣資源', 'pxzy'),('600491', '龍元建設', 'lyjs'),('600493', '鳳竹紡織', 'fzfz'),('600495', '晉西車軸', 'jxcz'),('600496', '精工鋼構', 'jggg'),('600497', '馳宏鋅鍺', 'chxz'),('600498', '烽火通信', 'fhtx'),('600499', '科達潔能', 'kdjn'),('600500', '中化國際', 'zhgj'),('600501', '航天晨光', 'htcg'),('600502', '安徽水利', 'ahsl'),('600503', '華麗家族', 'hljz'),('600505', '西昌電力', 'xcdl'),('600506', '香梨股份', 'xlgf'),('600507', '方大特鋼', 'fdtg'),('600508', '上海能源', 'shny'),('600509', '天富能源', 'tfny'),('600510', '黑牡丹', 'hmd'),('600511', '國藥股份', 'gygf'),('600512', '騰達建設', 'tdjs'),('600513', '聯環藥業', 'lhyy'),('600515', '海島建設', 'hdjs'),('600516', '方大炭素', 'fdts'),('600517', '置信電氣', 'zxdq'),('600518', '康美藥業', 'kmyy'),('600519', '貴州茅臺', 'gzmt'),('600520', '中發科技', 'zfkj'),('600521', '華海藥業', 'hhyy'),('600522', '中天科技', 'ztkj'),('600523', '貴航股份', 'ghgf'),('600525', '長園集團', 'zyjt'),('600526', '菲達環保', 'fdhb'),('600527', '江南高纖', 'jngx'),('600528', '中鐵二局', 'ztej'),('600529', '山東藥玻', 'sdyb'),('600530', '交大昂立', 'jdal'),('600531', '豫光金鉛', 'ygjq'),('600532', '宏達礦業', 'hdky'),('600533', '棲霞建設', 'qxjs'),('600535', '天士力', 'tsl'),('600536', '中國軟件', 'zgrj'),('600537', '億晶光電', 'yjgd'),('600538', '國發股份', 'gfgf'),('600539', '*ST獅頭', '*STst'),('600540', '新賽股份', 'xsgf'),('600543', '莫高股份', 'mggf'),('600545', '新疆城建', 'xjcj'),('600546', '山煤國際', 'smgj'),('600547', '山東黃金', 'sdhj'),('600548', '深高速', 'sgs'),('600549', '廈門鎢業', 'smwy'),('600550', '保變電氣', 'bbdq'),('600551', '時代出版', 'sdcb'),('600552', '方興科技', 'fxkj'),('600555', '九龍山', 'jls'),('600556', '慧球科技', 'hqkj'),('600557', '康緣藥業', 'kyyy'),('600558', '大西洋', 'dxy'),('600559', '老白干酒', 'lbgj'),('600560', '金自天正', 'jztz'),('600561', '江西長運', 'jxzy'),('600562', '國睿科技', 'grkj'),('600563', '法拉電子', 'fldz'),('600565', '迪馬股份', 'dmgf'),('600566', '濟川藥業', 'jcyy'),('600567', '山鷹紙業', 'syzy'),('600568', '中珠控股', 'zzkg'),('600569', '安陽鋼鐵', 'aygt'),('600570', '恒生電子', 'hsdz'),('600571', '信雅達', 'xyd'),('600572', '康恩貝', 'keb'),('600573', '惠泉啤酒', 'hqpj'),('600575', '皖江物流', 'wjwl'),('600576', '萬家文化', 'wjwh'),('600577', '精達股份', 'jdgf'),('600578', '京能電力', 'jndl'),('600579', '天華院', 'thy'),('600580', '臥龍電氣', 'wldq'),('600581', '八一鋼鐵', 'bygt'),('600582', '天地科技', 'tdkj'),('600583', '海油工程', 'hygc'),('600584', '長電科技', 'zdkj'),('600585', '海螺水泥', 'hlsn'),('600586', '金晶科技', 'jjkj'),('600587', '新華醫療', 'xhyl'),('600588', '用友網絡', 'yywl'),('600589', '廣東榕泰', 'gdrt'),('600590', '泰豪科技', 'thkj'),('600592', '龍溪股份', 'lxgf'),('600593', '大連圣亞', 'dlsy'),('600594', '益佰制藥', 'ybzy'),('600595', '中孚實業', 'zfsy'),('600596', '新安股份', 'xagf'),('600597', '光明乳業', 'gmry'),('600598', '北大荒', 'bdh'),('600599', '熊貓金控', 'xmjk'),('600600', '青島啤酒', 'qdpj'),('600601', '方正科技', 'fzkj'),('600602', '儀電電子', 'yddz'),('600603', '大洲興業', 'dzxy'),('600604', '市北高新', 'sbgx'),('600605', '匯通能源', 'htny'),('600606', '綠地控股', 'ldkg'),('600608', '*ST滬科', '*SThk'),('600609', '金杯汽車', 'jbqc'),('600610', '中毅達', 'zyd'),('600611', '大眾交通', 'dzjt'),('600612', '老鳳祥', 'lfx'),('600613', '神奇制藥', 'sqzy'),('600614', '鼎立股份', 'dlgf'),('600615', '豐華股份', 'fhgf'),('600616', '金楓酒業', 'jfjy'),('600617', '國新能源', 'gxny'),('600618', '氯堿化工', 'ljhg'),('600619', '海立股份', 'hlgf'),('600620', '天宸股份', 'tcgf'),('600621', '華鑫股份', 'hxgf'),('600622', '嘉寶集團', 'jbjt'),('600623', '雙錢股份', 'sqgf'),('600624', '復旦復華', 'fdfh'),('600626', '申達股份', 'sdgf'),('600628', '新世界', 'xsj'),('600629', '華建集團', 'hjjt'),('600630', '龍頭股份', 'ltgf'),('600633', '浙報傳媒', 'zbcm'),('600634', '中技控股', 'zjkg'),('600635', '大眾公用', 'dzgy'),('600636', '三愛富', 'saf'),('600637', '東方明珠', 'dfmz'),('600638', '新黃浦', 'xhp'),('600639', '浦東金橋', 'pdjq'),('600640', '號百控股', 'hbkg'),('600641', '萬業企業', 'wyqy'),('600642', '申能股份', 'sngf'),('600643', '愛建集團', 'ajjt'),('600644', '*ST樂電', '*STld'),('600645', '中源協和', 'zyxh'),('600647', '同達創業', 'tdcy'),('600648', '外高橋', 'wgq'),('600649', '城投控股', 'ctkg'),('600650', '錦江投資', 'jjtz'),('600651', '飛樂音響', 'flyx'),('600652', '游久游戲', 'yjyx'),('600653', '申華控股', 'shkg'),('600654', '中安消', 'zax'),('600655', '豫園商城', 'yysc'),('600657', '信達地產', 'xddc'),('600658', '電子城', 'dzc'),('600660', '福耀玻璃', 'fybl'),('600661', '新南洋', 'xny'),('600662', '強生控股', 'qskg'),('600663', '陸家嘴', 'ljz'),('600664', '哈藥股份', 'hygf'),('600665', '天地源', 'tdy'),('600666', '奧瑞德', 'ard'),('600667', '太極實業', 'tjsy'),('600668', '尖峰集團', 'jfjt'),('600671', '天目藥業', 'tmyy'),('600673', '東陽光科', 'dygk'),('600674', '川投能源', 'ctny'),('600675', '中華企業', 'zhqy'),('600676', '交運股份', 'jygf'),('600677', '航天通信', 'httx'),('600678', '四川金頂', 'scjd'),('600679', '金山開發', 'jskf'),('600680', '上海普天', 'shpt'),('600681', '萬鴻集團', 'whjt'),('600682', '南京新百', 'njxb'),('600683', '京投銀泰', 'jtyt'),('600684', '珠江實業', 'zjsy'),('600685', '中船防務', 'zcfw'),('600686', '金龍汽車', 'jlqc'),('600687', '剛泰控股', 'gtkg'),('600688', '上海石化', 'shsh'),('600689', '上海三毛', 'shsm'),('600690', '青島海爾', 'qdhe'),('600691', '*ST陽化', '*STyh'),('600692', '亞通股份', 'ytgf'),('600693', '東百集團', 'dbjt'),('600694', '大商股份', 'dsgf'),('600695', '綠庭投資', 'lttz'),('600696', '匹凸匹', 'ptp'),('600697', '歐亞集團', 'oyjt'),('600698', '湖南天雁', 'hnty'),('600699', '均勝電子', 'jsdz'),('600701', '工大高新', 'gdgx'),('600702', '沱牌舍得', 'tpsd'),('600703', '三安光電', 'sagd'),('600704', '物產中大', 'wczd'),('600705', '中航資本', 'zhzb'),('600706', '曲江文旅', 'qjwl'),('600707', '彩虹股份', 'chgf'),('600708', '光明地產', 'gmdc'),('600710', '*ST常林', '*STcl'),('600711', '盛屯礦業', 'stky'),('600712', '南寧百貨', 'nnbh'),('600713', '南京醫藥', 'njyy'),('600714', '金瑞礦業', 'jrky'),('600715', '*ST松遼', '*STsl'),('600716', '鳳凰股份', 'fhgf'),('600717', '天津港', 'tjg'),('600718', '東軟集團', 'drjt'),('600719', '大連熱電', 'dlrd'),('600720', '祁連山', 'qls'),('600721', '百花村', 'bhc'),('600722', '*ST金化', '*STjh'),('600723', '首商股份', 'ssgf'),('600724', '寧波富達', 'nbfd'),('600725', '云維股份', 'ywgf'),('600726', '華電能源', 'hdny'),('600727', '魯北化工', 'lbhg'),('600728', '佳都科技', 'jdkj'),('600729', '重慶百貨', 'zqbh'),('600730', '中國高科', 'zggk'),('600731', '湖南海利', 'hnhl'),('600732', '*ST新梅', '*STxm'),('600733', 'S前鋒', 'Sqf'),('600734', '實達集團', 'sdjt'),('600735', '新華錦', 'xhj'),('600736', '蘇州高新', 'szgx'),('600737', '中糧屯河', 'zlth'),('600738', '蘭州民百', 'lzmb'),('600739', '遼寧成大', 'lncd'),('600740', '山西焦化', 'sxjh'),('600741', '華域汽車', 'hyqc'),('600742', '一汽富維', 'yqfw'),('600743', '華遠地產', 'hydc'),('600744', '華銀電力', 'hydl'),('600745', '中茵股份', 'zygf'),('600746', '江蘇索普', 'jssp'),('600747', '大連控股', 'dlkg'),('600748', '上實發展', 'ssfz'),('600749', '西藏旅游', 'xzly'),('600750', '江中藥業', 'jzyy'),('600751', '天海投資', 'thtz'),('600753', '東方銀星', 'dfyx'),('600754', '錦江股份', 'jjgf'),('600755', '廈門國貿', 'smgm'),('600756', '浪潮軟件', 'lcrj'),('600757', '長江傳媒', 'zjcm'),('600758', '紅陽能源', 'hyny'),('600759', '洲際油氣', 'zjyq'),('600760', '中航黑豹', 'zhhb'),('600761', '安徽合力', 'ahhl'),('600763', '通策醫療', 'tcyl'),('600764', '中電廣通', 'zdgt'),('600765', '中航重機', 'zhzj'),('600766', '園城黃金', 'ychj'),('600767', '運盛醫療', 'ysyl'),('600768', '寧波富邦', 'nbfb'),('600769', '祥龍電業', 'xldy'),('600770', '綜藝股份', 'zygf'),('600771', '廣譽遠', 'gyy'),('600773', '西藏城投', 'xzct'),('600774', '漢商集團', 'hsjt'),('600775', '南京熊貓', 'njxm'),('600776', '東方通信', 'dftx'),('600777', '新潮實業', 'xcsy'),('600778', '友好集團', 'yhjt'),('600779', '*ST水井', '*STsj'),('600780', '通寶能源', 'tbny'),('600781', '輔仁藥業', 'fryy'),('600782', '新鋼股份', 'xggf'),('600783', '魯信創投', 'lxct'),('600784', '魯銀投資', 'lytz'),('600785', '新華百貨', 'xhbh'),('600787', '中儲股份', 'zcgf'),('600789', '魯抗醫藥', 'lkyy'),('600790', '輕紡城', 'qfc'),('600791', '京能置業', 'jnzy'),('600792', '云煤能源', 'ymny'),('600793', 'ST宜紙', 'STyz'),('600794', '保稅科技', 'bskj'),('600795', '國電電力', 'gddl'),('600796', '錢江生化', 'qjsh'),('600797', '浙大網新', 'zdwx'),('600798', '寧波海運', 'nbhy'),('600800', '天津磁卡', 'tjck'),('600801', '華新水泥', 'hxsn'),('600802', '福建水泥', 'fjsn'),('600803', '新奧股份', 'xagf'),('600804', '鵬博士', 'pbs'),('600805', '悅達投資', 'ydtz'),('600806', '昆明機床', 'kmjc'),('600807', '天業股份', 'tygf'),('600808', '馬鋼股份', 'mggf'),('600809', '山西汾酒', 'sxfj'),('600810', '神馬股份', 'smgf'),('600811', '東方集團', 'dfjt'),('600812', '華北制藥', 'hbzy'),('600814', '杭州解百', 'hzjb'),('600815', '廈工股份', 'sggf'),('600816', '安信信托', 'axxt'),('600817', 'ST宏盛', 'SThs'),('600818', '中路股份', 'zlgf'),('600819', '耀皮玻璃', 'ypbl'),('600820', '隧道股份', 'sdgf'),('600821', '津勸業', 'jqy'),('600822', '上海物貿', 'shwm'),('600823', '世茂股份', 'smgf'),('600824', '益民集團', 'ymjt'),('600825', '新華傳媒', 'xhcm'),('600826', '蘭生股份', 'lsgf'),('600827', '百聯股份', 'blgf'),('600828', '成商集團', 'csjt'),('600829', '人民同泰', 'rmtt'),('600830', '香溢融通', 'xyrt'),('600831', '廣電網絡', 'gdwl'),('600833', '第一醫藥', 'dyyy'),('600834', '申通地鐵', 'stdt'),('600835', '上海機電', 'shjd'),('600836', '界龍實業', 'jlsy'),('600837', '海通證券', 'htzq'),('600838', '上海九百', 'shjb'),('600839', '四川長虹', 'sczh'),('600841', '上柴股份', 'scgf'),('600843', '上工申貝', 'sgsb'),('600844', '丹化科技', 'dhkj'),('600845', '寶信軟件', 'bxrj'),('600846', '同濟科技', 'tjkj'),('600847', '萬里股份', 'wlgf'),('600848', '上海臨港', 'shlg'),('600850', '華東電腦', 'hddn'),('600851', '海欣股份', 'hxgf'),('600853', '龍建股份', 'ljgf'),('600854', '春蘭股份', 'clgf'),('600855', '航天長峰', 'htzf'),('600856', '中天能源', 'ztny'),('600857', '寧波中百', 'nbzb'),('600858', '銀座股份', 'yzgf'),('600859', '王府井', 'wfj'),('600860', '京城股份', 'jcgf'),('600861', '北京城鄉', 'bjcx'),('600862', '南通科技', 'ntkj'),('600863', '內蒙華電', 'nmhd'),('600864', '哈投股份', 'htgf'),('600865', '百大集團', 'bdjt'),('600866', '星湖科技', 'xhkj'),('600867', '通化東寶', 'thdb'),('600868', '梅雁吉祥', 'myjx'),('600869', '智慧能源', 'zhny'),('600870', '*ST廈華', '*STsh'),('600871', '石化油服', 'shyf'),('600872', '中炬高新', 'zjgx'),('600873', '梅花生物', 'mhsw'),('600874', '創業環保', 'cyhb'),('600875', '東方電氣', 'dfdq'),('600876', '洛陽玻璃', 'lybl'),('600877', '中國嘉陵', 'zgjl'),('600879', '航天電子', 'htdz'),('600880', '博瑞傳播', 'brcb'),('600881', '亞泰集團', 'ytjt'),('600882', '華聯礦業', 'hlky'),('600883', '博聞科技', 'bwkj'),('600884', '杉杉股份', 'ssgf'),('600885', '宏發股份', 'hfgf'),('600886', '國投電力', 'gtdl'),('600887', '伊利股份', 'ylgf'),('600888', '新疆眾和', 'xjzh'),('600889', '南京化纖', 'njhx'),('600890', '中房股份', 'zfgf'),('600891', '秋林集團', 'qljt'),('600892', '寶誠股份', 'bcgf'),('600893', '中航動力', 'zhdl'),('600894', '廣日股份', 'grgf'),('600895', '張江高科', 'zjgk'),('600896', '中海海盛', 'zhhs'),('600897', '廈門空港', 'smkg'),('600898', '三聯商社', 'slss'),('600900', '長江電力', 'zjdl'),('600917', '重慶燃氣', 'zqrq'),('600958', '東方證券', 'dfzq'),('600959', '江蘇有線', 'jsyx'),('600960', '渤海活塞', 'bhhs'),('600961', '株冶集團', 'zyjt'),('600962', '*ST中魯', '*STzl'),('600963', '岳陽林紙', 'yylz'),('600965', '福成五豐', 'fcwf'),('600966', '博匯紙業', 'bhzy'),('600967', '北方創業', 'bfcy'),('600969', '郴電國際', 'cdgj'),('600970', '中材國際', 'zcgj'),('600971', '恒源煤電', 'hymd'),('600973', '寶勝股份', 'bsgf'),('600975', '新五豐', 'xwf'),('600976', '健民集團', 'jmjt'),('600978', '宜華木業', 'yhmy'),('600979', '廣安愛眾', 'gaaz'),('600980', '北礦磁材', 'bkcc'),('600981', '匯鴻集團', 'hhjt'),('600982', '寧波熱電', 'nbrd'),('600983', '惠而浦', 'hep'),('600984', '*ST建機', '*STjj'),('600985', '雷鳴科化', 'lmkh'),('600986', '科達股份', 'kdgf'),('600987', '航民股份', 'hmgf'),('600988', '赤峰黃金', 'cfhj'),('600990', '四創電子', 'scdz'),('600992', '貴繩股份', 'gsgf'),('600993', '馬應龍', 'myl'),('600995', '文山電力', 'wsdl'),('600997', '開灤股份', 'klgf'),('600998', '九州通', 'jzt'),('600999', '招商證券', 'zszq'),('601000', '唐山港', 'tsg'),('601001', '大同煤業', 'dtmy'),('601002', '晉億實業', 'jysy'),('601003', '柳鋼股份', 'lggf'),('601005', '重慶鋼鐵', 'zqgt'),('601006', '大秦鐵路', 'dqtl'),('601007', '金陵飯店', 'jlfd'),('601008', '連云港', 'lyg'),('601009', '南京銀行', 'njyx'),('601010', '文峰股份', 'wfgf'),('601011', '寶泰隆', 'btl'),('601012', '隆基股份', 'ljgf'),('601015', '陜西黑貓', 'sxhm'),('601016', '節能風電', 'jnfd'),('601018', '寧波港', 'nbg'),('601021', '春秋航空', 'cqhk'),('601028', '玉龍股份', 'ylgf'),('601038', '一拖股份', 'ytgf'),('601058', '賽輪金宇', 'sljy'),('601069', '西部黃金', 'xbhj'),('601088', '中國神華', 'zgsh'),('601098', '中南傳媒', 'zncm'),('601099', '太平洋', 'tpy'),('601100', '恒立油缸', 'hlyg'),('601101', '昊華能源', 'hhny'),('601106', '中國一重', 'zgyz'),('601107', '四川成渝', 'sccy'),('601111', '中國國航', 'zggh'),('601113', '華鼎股份', 'hdgf'),('601116', '三江購物', 'sjgw'),('601117', '中國化學', 'zghx'),('601118', '海南橡膠', 'hnxj'),('601126', '四方股份', 'sfgf'),('601137', '博威合金', 'bwhj'),('601139', '深圳燃氣', 'szrq'),('601155', '新城控股', 'xckg'),('601158', '重慶水務', 'zqsw'),('601166', '興業銀行', 'xyyx'),('601168', '西部礦業', 'xbky'),('601169', '北京銀行', 'bjyx'),('601177', '杭齒前進', 'hcqj'),('601179', '中國西電', 'zgxd'),('601186', '中國鐵建', 'zgtj'),('601188', '龍江交通', 'ljjt'),('601198', '東興證券', 'dxzq'),('601199', '江南水務', 'jnsw'),('601208', '東材科技', 'dckj'),('601211', '國泰君安', 'gtja'),('601216', '君正集團', 'jzjt'),('601218', '吉鑫科技', 'jxkj'),('601222', '林洋能源', 'lyny'),('601225', '陜西煤業', 'sxmy'),('601226', '華電重工', 'hdzg'),('601231', '環旭電子', 'hxdz'),('601233', '桐昆股份', 'tkgf'),('601238', '廣汽集團', 'gqjt'),('601258', '龐大集團', 'pdjt'),('601288', '農業銀行', 'nyyx'),('601311', '駱駝股份', 'ltgf'),('601313', '江南嘉捷', 'jnjj'),('601318', '中國平安', 'zgpa'),('601328', '交通銀行', 'jtyx'),('601333', '廣深鐵路', 'gstl'),('601336', '新華保險', 'xhbx'),('601339', '百隆東方', 'bldf'),('601368', '綠城水務', 'lcsw'),('601369', '陜鼓動力', 'sgdl'),('601377', '興業證券', 'xyzq'),('601388', '怡球資源', 'yqzy'),('601390', '中國中鐵', 'zgzt'),('601398', '工商銀行', 'gsyx'),('601515', '東風股份', 'dfgf'),('601518', '吉林高速', 'jlgs'),('601519', '大智慧', 'dzh'),('601555', '東吳證券', 'dwzq'),('601558', '華銳風電', 'hrfd'),('601566', '九牧王', 'jmw'),('601567', '三星醫療', 'sxyl'),('601579', '會稽山', 'hjs'),('601588', '北辰實業', 'bcsy'),('601599', '鹿港科技', 'lgkj'),('601600', '中國鋁業', 'zgly'),('601601', '中國太保', 'zgtb'),('601607', '上海醫藥', 'shyy'),('601608', '中信重工', 'zxzg'),('601616', '廣電電氣', 'gddq'),('601618', '中國中冶', 'zgzy'),('601628', '中國人壽', 'zgrs'),('601633', '長城汽車', 'zcqc'),('601636', '旗濱集團', 'qbjt'),('601666', '平煤股份', 'pmgf'),('601668', '中國建筑', 'zgjz'),('601669', '中國電建', 'zgdj'),('601677', '明泰鋁業', 'mtly'),('601678', '濱化股份', 'bhgf'),('601688', '華泰證券', 'htzq'),('601689', '拓普集團', 'tpjt'),('601699', '潞安環能', 'lahn'),('601700', '風范股份', 'ffgf'),('601717', '鄭煤機', 'zmj'),('601718', '際華集團', 'jhjt'),('601727', '上海電氣', 'shdq'),('601766', '中國中車', 'zgzc'),('601777', '力帆股份', 'lfgf'),('601788', '光大證券', 'gdzq'),('601789', '寧波建工', 'nbjg'),('601798', '藍科高新', 'lkgx'),('601799', '星宇股份', 'xygf'),('601800', '中國交建', 'zgjj'),('601801', '皖新傳媒', 'wxcm'),('601808', '中海油服', 'zhyf'),('601818', '光大銀行', 'gdyx'),('601857', '中國石油', 'zgsy'),('601866', '中海集運', 'zhjy'),('601872', '招商輪船', 'zslc'),('601877', '正泰電器', 'ztdq'),('601880', '大連港', 'dlg'),('601886', '江河創建', 'jhcj'),('601888', '中國國旅', 'zggl'),('601890', '亞星錨鏈', 'yxml'),('601898', '中煤能源', 'zmny'),('601899', '紫金礦業', 'zjky'),('601901', '方正證券', 'fzzq'),('601908', '京運通', 'jyt'),('601918', '國投新集', 'gtxj'),('601919', '中國遠洋', 'zgyy'),('601928', '鳳凰傳媒', 'fhcm'),('601929', '吉視傳媒', 'jscm'),('601933', '永輝超市', 'yhcs'),('601939', '建設銀行', 'jsyx'),('601958', '金鉬股份', 'jmgf'),('601965', '中國汽研', 'zgqy'),('601968', '寶鋼包裝', 'bgbz'),('601969', '海南礦業', 'hnky'),('601985', '中國核電', 'zghd'),('601988', '中國銀行', 'zgyx'),('601989', '中國重工', 'zgzg'),('601991', '大唐發電', 'dtfd'),('601992', '金隅股份', 'jygf'),('601996', '豐林集團', 'fljt'),('601998', '中信銀行', 'zxyx'),('601999', '出版傳媒', 'cbcm'),('603000', '人民網', 'rmw'),('603001', '奧康國際', 'akgj'),('603002', '宏昌電子', 'hcdz'),('603003', '龍宇燃油', 'lyry'),('603005', '晶方科技', 'jfkj'),('603006', '聯明股份', 'lmgf'),('603008', '喜臨門', 'xlm'),('603009', '北特科技', 'btkj'),('603010', '萬盛股份', 'wsgf'),('603011', '合鍛股份', 'hdgf'),('603012', '創力集團', 'cljt'),('603015', '弘訊科技', 'hxkj'),('603017', '中衡設計', 'zhsj'),('603018', '設計股份', 'sjgf'),('603019', '中科曙光', 'zksg'),('603020', '愛普股份', 'apgf'),('603021', '山東華鵬', 'sdhp'),('603022', '新通聯', 'xtl'),('603023', '威帝股份', 'wdgf'),('603025', '大豪科技', 'dhkj'),('603026', '石大勝華', 'sdsh'),('603030', '全筑股份', 'qzgf'),('603066', '音飛儲存', 'yfcc'),('603077', '和邦生物', 'hbsw'),('603085', '天成自控', 'tczk'),('603088', '寧波精達', 'nbjd'),('603099', '長白山', 'zbs'),('603100', '川儀股份', 'cygf'),('603108', '潤達醫療', 'rdyl'),('603111', '康尼機電', 'knjd'),('603116', '紅蜻蜓', 'hqt'),('603117', '萬林股份', 'wlgf'),('603118', '共進股份', 'gjgf'),('603123', '翠微股份', 'cwgf'),('603126', '中材節能', 'zcjn'),('603128', '華貿物流', 'hmwl'),('603158', '騰龍股份', 'tlgf'),('603166', '福達股份', 'fdgf'),('603167', '渤海輪渡', 'bhld'),('603168', '莎普愛思', 'spas'),('603169', '蘭石重裝', 'lszz'),('603188', '亞邦股份', 'ybgf'),('603198', '迎駕貢酒', 'yjgj'),('603199', '九華旅游', 'jhly'),('603222', '濟民制藥', 'jmzy'),('603223', '恒通股份', 'htgf'),('603227', '雪峰科技', 'xfkj'),('603268', '松發股份', 'sfgf'),('603288', '海天味業', 'htwy'),('603299', '井神股份', 'jsgf'),('603300', '華鐵科技', 'htkj'),('603306', '華懋科技', 'hmkj'),('603308', '應流股份', 'ylgf'),('603309', '維力醫療', 'wlyl'),('603311', '金海環境', 'jhhj'),('603315', '福鞍股份', 'fagf'),('603318', '派思股份', 'psgf'),('603328', '依頓電子', 'yddz'),('603333', '明星電纜', 'mxdl'),('603338', '浙江鼎力', 'zjdl'),('603355', '萊克電氣', 'lkdq'),('603366', '日出東方', 'rcdf'),('603368', '柳州醫藥', 'lzyy'),('603369', '今世緣', 'jsy'),('603398', '邦寶益智', 'bbyz'),('603399', '新華龍', 'xhl'),('603456', '九洲藥業', 'jzyy'),('603508', '思維列控', 'swlk'),('603518', '維格娜絲', 'wgns'),('603519', '立霸股份', 'lbgf'),('603555', '貴人鳥', 'grn'),('603558', '健盛集團', 'jsjt'),('603566', '普萊柯', 'plk'),('603567', '珍寶島', 'zbd'),('603568', '偉明環保', 'wmhb'),('603588', '高能環境', 'gnhj'),('603589', '口子窖', 'kzj'),('603598', '引力傳媒', 'ylcm'),('603599', '廣信股份', 'gxgf'),('603600', '永藝股份', 'yygf'),('603601', '再升科技', 'zskj'),('603606', '東方電纜', 'dfdl'),('603609', '禾豐牧業', 'hfmy'),('603611', '諾力股份', 'nlgf'),('603616', '韓建河山', 'hjhs'),('603618', '杭電股份', 'hdgf'),('603636', '南威軟件', 'nwrj'),('603669', '靈康藥業', 'lkyy'),('603678', '火炬電子', 'hjdz'),('603686', '龍馬環衛', 'lmhw'),('603688', '石英股份', 'sygf'),('603696', '安記食品', 'ajsp'),('603698', '航天工程', 'htgc'),('603699', '紐威股份', 'nwgf'),('603703', '盛洋科技', 'sykj'),('603718', '海利生物', 'hlsw'),('603729', '龍韻股份', 'lygf'),('603766', '隆鑫通用', 'lxty'),('603778', '乾景園林', 'qjyl'),('603788', '寧波高發', 'nbgf'),('603789', '星光農機', 'xgnj'),('603799', '華友鈷業', 'hygy'),('603800', '道森股份', 'dsgf'),('603806', '福斯特', 'fst'),('603808', '歌力思', 'gls'),('603818', '曲美家居', 'qmjj'),('603828', '柯利達', 'kld'),('603838', '四通股份', 'stgf'),('603866', '桃李面包', 'tlmb'),('603869', '北部灣旅', 'bbwl'),('603883', '老百姓', 'lbx'),('603885', '吉祥航空', 'jxhk'),('603889', '新澳股份', 'xagf'),('603898', '好萊客', 'hlk'),('603899', '晨光文具', 'cgwj'),('603901', '永創智能', 'yczn'),('603918', '金橋信息', 'jqxx'),('603936', '博敏電子', 'bmdz'),('603939', '益豐藥房', 'yfyf'),('603968', '醋化股份', 'chgf'),('603969', '銀龍股份', 'ylgf'),('603979', '金誠信', 'jcx'),('603988', '中電電機', 'zddj'),('603989', '艾華集團', 'ahjt'),('603993', '洛陽鉬業', 'lymy'),('603996', '中新科技', 'zxkj'),('603997', '繼峰股份', 'jfgf'),('603998', '方盛制藥', 'fszy'),('603999', '讀者傳媒', 'dzcm'),('900901', '儀電B股', 'ydBg'),('900902', '市北B股', 'sbBg'),('900903', '大眾B股', 'dzBg'),('900904', '神奇B股', 'sqBg'),('900905', '老鳳祥B', 'lfxB'),('900906', '中毅達B', 'zydB'),('900907', '鼎立B股', 'dlBg'),('900908', '氯堿B股', 'ljBg'),('900909', '雙錢B股', 'sqBg'),('900910', '海立B股', 'hlBg'),('900911', '金橋B股', 'jqBg'),('900912', '外高B股', 'wgBg'),('900913', '國新B股', 'gxBg'),('900914', '錦投B股', 'jtBg'),('900915', '中路B股', 'zlBg'),('900916', '金山B股', 'jsBg'),('900917', '海欣B股', 'hxBg'),('900918', '耀皮B股', 'ypBg'),('900919', '綠庭B股', 'ltBg'),('900920', '上柴B股', 'scBg'),('900921', '丹科B股', 'dkBg'),('900922', '三毛B股', 'smBg'),('900923', '百聯B股', 'blBg'),('900924', '上工B股', 'sgBg'),('900925', '機電B股', 'jdBg'),('900926', '寶信B', 'bxB'),('900927', '物貿B股', 'wmBg'),('900928', '臨港B股', 'lgBg'),('900929', '錦旅B股', 'jlBg'),('900930', '滬普天B', 'hptB'),('900932', '陸家B股', 'ljBg'),('900933', '華新B股', 'hxBg'),('900934', '錦江B股', 'jjBg'),('900935', '陽晨B股', 'ycBg'),('900936', '鄂資B股', 'ezBg'),('900937', '華電B股', 'hdBg'),('900938', '天海B', 'thB'),('900939', '匯麗B', 'hlB'),('900940', '大名城B', 'dmcB'),('900941', '東信B股', 'dxBg'),('900942', '黃山B股', 'hsBg'),('900943', '開開B股', 'kkBg'),('900945', '海航B股', 'hhBg'),('900946', '天雁B股', 'tyBg'),('900947', '振華B股', 'zhBg'),('900948', '伊泰B股', 'ytBg'),('900950', '新城B股', 'xcBg'),('900951', '大化B股', 'dhBg'),('900952', '錦港B股', 'jgBg'),('900953', '凱馬B', 'kmB'),('900955', '九龍山B', 'jlsB'),('900956', '東貝B股', 'dbBg'),('900957', '凌云B股', 'lyBg')]# 2. get history data class HistoryInfo():def __init__(self, history_data, product, cur_year, cur_month):self.history_data = history_dataself.product = productself.cur_year= cur_yearself.cur_month = cur_monthclass ExecuteGet(threading.Thread):def __init__(self, obj):threading.Thread.__init__(self)self.obj = objdef run(self):while 1:self.obj.cond_get.acquire()while len(self.obj.stack)==0:if self.obj.th_stop==True:self.obj.cond_put.notifyAll()self.obj.cond_get.release()exit(0)self.obj.cond_get.wait()history_info = self.obj.stack.pop()self.obj.cond_put.notifyAll()self.obj.cond_get.release()self.get_product_history(history_info.history_data, history_info.product, \history_info.cur_year, history_info.cur_month)def get_product_history(self, history_data, product, cur_year, cur_month):url_pattern = 'http://money.finance.sina.com.cn/corp/go.php/vMS_MarketHistory/stockid/603299.phtml?year=2015&jidu=4'headers_str = '''Host: money.finance.sina.com.cnUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0'''headers_list = re.findall(r'(.*?):(.*)', headers_str)headers = {}for item in headers_list:headers[item[0]] = item[1]map_month_to_jidu = {1 : 1, 2 : 1, 3 : 1, 4 : 2, 5 : 2, 6 : 2,7 : 3, 8 : 3, 9 : 3, 10 : 4, 11 : 4, 12 : 4}for i in range(0, 10):# get urlmonth = cur_month - 3 * isecs = time.mktime((cur_year, month, 1, 0, 0, 0, 0, 0, 0))year = time.localtime(secs).tm_yearjidu = map_month_to_jidu[time.localtime(secs).tm_mon]url = re.sub(r'stockid.*4', 'stockid/%s.phtml?year=%d&jidu=%d' % (product, year, jidu), url_pattern)url_err = url + "\n"sys.stderr.write(url_err)# get htmltimes = 10while times>0:try:html = requests.get(url=url, headers=headers, timeout=16)breakexcept requests.ConnectionError as e:times -= 1if html.encoding == 'ISO-8859-1':encodings = requests.utils.get_encodings_from_content(html.text)if encodings:html.encoding = encodings[0]else:html.encoding = html.apparent_encoding# edit datasoup = BeautifulSoup(html.text, 'html.parser')soup = soup.find(id="FundHoldSharesTable")if (soup == None):continuedata_text = soup.get_text()data_text = re.sub(r'[ \t]+', r'', data_text)data_text = re.sub(r'[^\d\.\n-]', r'', data_text)data_list = re.findall(r'(\d.*?)\n', data_text)if data_list:assert data_list[0]==productfor i in range(1, len(data_list), 7):history_data[product].append((data_list[i], data_list[i+1],data_list[i+2], data_list[i+3],data_list[i+4], data_list[i+5],data_list[i+6]))class GetProductHistory(object):stack = []lock = threading.Lock()cond_put = threading.Condition(lock)cond_get = threading.Condition(lock)th = []thnum = 8def start(self):self.th_stop = Falseself.stack = []self.th = []for i in range(self.thnum):th = ExecuteGet(self)th.start()self.th.append(th)def put(self, history_data, product, cur_year, cur_month):history_info = HistoryInfo(history_data, product, cur_year, cur_month)self.cond_put.acquire()while len(self.stack) == self.thnum:self.cond_put.wait()self.stack.append(history_info)self.cond_get.notifyAll()self.cond_put.release()def stop(self):self.th_stop = Truefor th in self.th:th.join()history_data = {} cur_year = int(time.strftime("%Y")) cur_month = int(time.strftime("%m"))get_data = GetProductHistory() get_data.start() for item in list_product:product = item[0]history_data[product] = []get_data.put(history_data, product, cur_year, cur_month)get_data.stop()for item in list_product:product = item[0]print(product)print(history_data[product])總結
以上是生活随笔為你收集整理的Python编程的例子----股票数据接口的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 虚拟机未安装音频设备_如何使用虚拟音频设
- 下一篇: 探索性数据分析