保定市做网站,创意产品,网页设计 教程网站,空压机网站开发公司前面做了更新沪深交易所的上市股票列表的读取和更新#xff0c;但一旦股票退市则需要在数据库里将该股票状态更新为退市#xff0c;同时附上退市日期#xff0c;将股票名更改为XX退。 此外深交所下载的xls解析出来是没有上市公司所属的二级行业的#xff0c;因此还需要建立…前面做了更新沪深交易所的上市股票列表的读取和更新但一旦股票退市则需要在数据库里将该股票状态更新为退市同时附上退市日期将股票名更改为XX退。 此外深交所下载的xls解析出来是没有上市公司所属的二级行业的因此还需要建立一个一二级行业的数据库表来保存行业信息同时补全深交所上市公司的二级行业信息。 更新退市股票的爬虫这个暂时没有等后面做了再放上来。我从来不买垃圾股所以对退市股票不着急做 上市公司的一二级行业分类见这个表 这个表可以在这里《中国上市公司协会上市公司行业统计分类指引》下载到。 这张表在我们数据库里对应的就是stock_a数据库下面的industry_classification这张表这里放上我手工做好的industry_classification的SQL代码
/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 5.0.96-community-nt
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;create table industry_classification (industry_code varchar (12),industry_name varchar (150)
);
insert into industry_classification (industry_code, industry_name) values(A,农、林、牧、渔业);
insert into industry_classification (industry_code, industry_name) values(A01,农业);
insert into industry_classification (industry_code, industry_name) values(A02,林业);
insert into industry_classification (industry_code, industry_name) values(A03,畜牧业);
insert into industry_classification (industry_code, industry_name) values(A04,渔业);
insert into industry_classification (industry_code, industry_name) values(A05,农、林、牧、渔专业及辅助性活动);
insert into industry_classification (industry_code, industry_name) values(B,采矿业);
insert into industry_classification (industry_code, industry_name) values(B06,煤炭开采和洗选业);
insert into industry_classification (industry_code, industry_name) values(B07,石油和天然气开采业);
insert into industry_classification (industry_code, industry_name) values(B08,黑色金属矿采选业);
insert into industry_classification (industry_code, industry_name) values(B09,有色金属矿采选业);
insert into industry_classification (industry_code, industry_name) values(B10,非金属矿采选业);
insert into industry_classification (industry_code, industry_name) values(B11,开采专业及辅助性活动);
insert into industry_classification (industry_code, industry_name) values(B12,其他采矿业);
insert into industry_classification (industry_code, industry_name) values(C,制造业);
insert into industry_classification (industry_code, industry_name) values(C13,农副食品加工业);
insert into industry_classification (industry_code, industry_name) values(C14,食品制造业);
insert into industry_classification (industry_code, industry_name) values(C15,酒、饮料和精制茶制造业);
insert into industry_classification (industry_code, industry_name) values(C16,烟草制品业);
insert into industry_classification (industry_code, industry_name) values(C17,纺织业);
insert into industry_classification (industry_code, industry_name) values(C18,纺织服装、服饰业);
insert into industry_classification (industry_code, industry_name) values(C19,皮革、毛皮、羽毛及其制品和制鞋业);
insert into industry_classification (industry_code, industry_name) values(C20,木材加工和木、竹、藤、棕、草制品业);
insert into industry_classification (industry_code, industry_name) values(C21,家具制造业);
insert into industry_classification (industry_code, industry_name) values(C22,造纸和纸制品业);
insert into industry_classification (industry_code, industry_name) values(C23,印刷和记录媒介复制业);
insert into industry_classification (industry_code, industry_name) values(C24,文教、工美、体育和娱乐用品制造业);
insert into industry_classification (industry_code, industry_name) values(C25,石油、煤炭及其他燃料加工业);
insert into industry_classification (industry_code, industry_name) values(C26,化学原料和化学制品制造业);
insert into industry_classification (industry_code, industry_name) values(C27,医药制造业);
insert into industry_classification (industry_code, industry_name) values(C28,化学纤维制造业);
insert into industry_classification (industry_code, industry_name) values(C29,橡胶和塑料制品业);
insert into industry_classification (industry_code, industry_name) values(C30,非金属矿物制品业);
insert into industry_classification (industry_code, industry_name) values(C31,黑色金属冶炼和压延加工业);
insert into industry_classification (industry_code, industry_name) values(C32,有色金属冶炼和压延加工业);
insert into industry_classification (industry_code, industry_name) values(C33,金属制品业);
insert into industry_classification (industry_code, industry_name) values(C34,通用设备制造业);
insert into industry_classification (industry_code, industry_name) values(C35,专用设备制造业);
insert into industry_classification (industry_code, industry_name) values(C36,汽车制造业);
insert into industry_classification (industry_code, industry_name) values(C37,铁路、船舶、航空航天和其他运输设备制造业);
insert into industry_classification (industry_code, industry_name) values(C38,电气机械和器材制造业);
insert into industry_classification (industry_code, industry_name) values(C39,计算机、通信和其他电子设备制造业);
insert into industry_classification (industry_code, industry_name) values(C40,仪器仪表制造业);
insert into industry_classification (industry_code, industry_name) values(C41,其他制造业);
insert into industry_classification (industry_code, industry_name) values(C42,废弃资源综合利用业);
insert into industry_classification (industry_code, industry_name) values(C43,金属制品、机械和设备修理业);
insert into industry_classification (industry_code, industry_name) values(D,电力、热力、燃气及水生产和供应业);
insert into industry_classification (industry_code, industry_name) values(D44,电力、热力生产和供应业);
insert into industry_classification (industry_code, industry_name) values(D45,燃气生产和供应业);
insert into industry_classification (industry_code, industry_name) values(D46,水的生产和供应业);
insert into industry_classification (industry_code, industry_name) values(E,建筑业);
insert into industry_classification (industry_code, industry_name) values(E47,房屋建筑业);
insert into industry_classification (industry_code, industry_name) values(E48,土木工程建筑业);
insert into industry_classification (industry_code, industry_name) values(E49,建筑安装业);
insert into industry_classification (industry_code, industry_name) values(E50,建筑装饰、装修和其他建筑业);
insert into industry_classification (industry_code, industry_name) values(F,批发和零售业);
insert into industry_classification (industry_code, industry_name) values(F51,批发业);
insert into industry_classification (industry_code, industry_name) values(F52,零售业);
insert into industry_classification (industry_code, industry_name) values(G,交通运输、仓储和邮政业);
insert into industry_classification (industry_code, industry_name) values(G53,铁路运输业);
insert into industry_classification (industry_code, industry_name) values(G54,道路运输业);
insert into industry_classification (industry_code, industry_name) values(G55,水上运输业);
insert into industry_classification (industry_code, industry_name) values(G56,航空运输业);
insert into industry_classification (industry_code, industry_name) values(G57,管道运输业);
insert into industry_classification (industry_code, industry_name) values(G58,多式联运和运输代理业);
insert into industry_classification (industry_code, industry_name) values(G59,装卸搬运和仓储业);
insert into industry_classification (industry_code, industry_name) values(G60,邮政业);
insert into industry_classification (industry_code, industry_name) values(H,住宿和餐饮业);
insert into industry_classification (industry_code, industry_name) values(H61,住宿业);
insert into industry_classification (industry_code, industry_name) values(H62,餐饮业);
insert into industry_classification (industry_code, industry_name) values(I,信息传输、软件和信息技术服务业);
insert into industry_classification (industry_code, industry_name) values(I63,电信、广播电视和卫星传输服务);
insert into industry_classification (industry_code, industry_name) values(I64,互联网和相关服务);
insert into industry_classification (industry_code, industry_name) values(I65,软件和信息技术服务业);
insert into industry_classification (industry_code, industry_name) values(J,金融业);
insert into industry_classification (industry_code, industry_name) values(J66,货币金融服务);
insert into industry_classification (industry_code, industry_name) values(J67,资本市场服务);
insert into industry_classification (industry_code, industry_name) values(J68,保险业);
insert into industry_classification (industry_code, industry_name) values(J69,其他金融业);
insert into industry_classification (industry_code, industry_name) values(K,房地产业);
insert into industry_classification (industry_code, industry_name) values(K70,房地产业);
insert into industry_classification (industry_code, industry_name) values(L,租赁和商务服务业);
insert into industry_classification (industry_code, industry_name) values(L71,租赁业);
insert into industry_classification (industry_code, industry_name) values(L72,商务服务业);
insert into industry_classification (industry_code, industry_name) values(M,科学研究和技术服务业);
insert into industry_classification (industry_code, industry_name) values(M73,研究和试验发展);
insert into industry_classification (industry_code, industry_name) values(M74,专业技术服务业);
insert into industry_classification (industry_code, industry_name) values(M75,科技推广和应用服务业);
insert into industry_classification (industry_code, industry_name) values(N,水利、环境和公共设施管理业);
insert into industry_classification (industry_code, industry_name) values(N76,水利管理业);
insert into industry_classification (industry_code, industry_name) values(N77,生态保护和环境治理业);
insert into industry_classification (industry_code, industry_name) values(N78,公共设施管理业);
insert into industry_classification (industry_code, industry_name) values(N79,土地管理业);
insert into industry_classification (industry_code, industry_name) values(O,居民服务、修理和其他服务业);
insert into industry_classification (industry_code, industry_name) values(O80,居民服务业);
insert into industry_classification (industry_code, industry_name) values(O81,机动车、电子产品和日用产品修理业);
insert into industry_classification (industry_code, industry_name) values(O82,其他服务业);
insert into industry_classification (industry_code, industry_name) values(P,教育);
insert into industry_classification (industry_code, industry_name) values(P83,教育);
insert into industry_classification (industry_code, industry_name) values(Q,卫生和社会工作);
insert into industry_classification (industry_code, industry_name) values(Q84,卫生);
insert into industry_classification (industry_code, industry_name) values(Q85,社会工作);
insert into industry_classification (industry_code, industry_name) values(R,文化、体育和娱乐业);
insert into industry_classification (industry_code, industry_name) values(R86,新闻和出版业);
insert into industry_classification (industry_code, industry_name) values(R87,广播、电视、电影和录音制作业);
insert into industry_classification (industry_code, industry_name) values(R88,文化艺术业);
insert into industry_classification (industry_code, industry_name) values(R89,体育);
insert into industry_classification (industry_code, industry_name) values(R90,娱乐业);
insert into industry_classification (industry_code, industry_name) values(S,综合);
insert into industry_classification (industry_code, industry_name) values(S91,综合);
上表包含所有一级行业和二级行业的分类。 接下来看深交所下载的xls解析出来是没有上市公司所属的二级行业这个事情 可以看到我圈红的地方只有一级行业而没有二级行业。这在后期搭建量化分析模型时会影响我们的筛选。因此需要写一个中国上市公司协会的爬虫读取和解析最新上市公司行业分类结果 爬虫代码还没写等后面写来放出来 文章转载自: http://www.morning.rynqh.cn.gov.cn.rynqh.cn http://www.morning.routalr.cn.gov.cn.routalr.cn http://www.morning.ghccq.cn.gov.cn.ghccq.cn http://www.morning.hmbxd.cn.gov.cn.hmbxd.cn http://www.morning.bxrqf.cn.gov.cn.bxrqf.cn http://www.morning.mhcft.cn.gov.cn.mhcft.cn http://www.morning.tnbas.com.gov.cn.tnbas.com http://www.morning.qdxtj.cn.gov.cn.qdxtj.cn http://www.morning.kzpxc.cn.gov.cn.kzpxc.cn http://www.morning.sgmis.com.gov.cn.sgmis.com http://www.morning.fndfn.cn.gov.cn.fndfn.cn http://www.morning.mmjyk.cn.gov.cn.mmjyk.cn http://www.morning.zlfxp.cn.gov.cn.zlfxp.cn http://www.morning.yrck.cn.gov.cn.yrck.cn http://www.morning.wdlg.cn.gov.cn.wdlg.cn http://www.morning.qggm.cn.gov.cn.qggm.cn http://www.morning.tgnr.cn.gov.cn.tgnr.cn http://www.morning.tgcw.cn.gov.cn.tgcw.cn http://www.morning.hotlads.com.gov.cn.hotlads.com http://www.morning.jjhrj.cn.gov.cn.jjhrj.cn http://www.morning.ggnjq.cn.gov.cn.ggnjq.cn http://www.morning.mrncd.cn.gov.cn.mrncd.cn http://www.morning.fjlsfs.com.gov.cn.fjlsfs.com http://www.morning.ykshx.cn.gov.cn.ykshx.cn http://www.morning.nchsz.cn.gov.cn.nchsz.cn http://www.morning.lanyee.com.cn.gov.cn.lanyee.com.cn http://www.morning.bzjpn.cn.gov.cn.bzjpn.cn http://www.morning.lxjxl.cn.gov.cn.lxjxl.cn http://www.morning.psxcr.cn.gov.cn.psxcr.cn http://www.morning.ppbqz.cn.gov.cn.ppbqz.cn http://www.morning.bnbzd.cn.gov.cn.bnbzd.cn http://www.morning.cqrenli.com.gov.cn.cqrenli.com http://www.morning.lzttq.cn.gov.cn.lzttq.cn http://www.morning.ymjgx.cn.gov.cn.ymjgx.cn http://www.morning.ckdgj.cn.gov.cn.ckdgj.cn http://www.morning.ccjhr.cn.gov.cn.ccjhr.cn http://www.morning.rbgwj.cn.gov.cn.rbgwj.cn http://www.morning.yqsr.cn.gov.cn.yqsr.cn http://www.morning.sgrwd.cn.gov.cn.sgrwd.cn http://www.morning.htbbp.cn.gov.cn.htbbp.cn http://www.morning.skcmt.cn.gov.cn.skcmt.cn http://www.morning.ypfw.cn.gov.cn.ypfw.cn http://www.morning.jgcyn.cn.gov.cn.jgcyn.cn http://www.morning.nmbbt.cn.gov.cn.nmbbt.cn http://www.morning.rkwwy.cn.gov.cn.rkwwy.cn http://www.morning.btblm.cn.gov.cn.btblm.cn http://www.morning.rqqmd.cn.gov.cn.rqqmd.cn http://www.morning.qnzpg.cn.gov.cn.qnzpg.cn http://www.morning.yrycb.cn.gov.cn.yrycb.cn http://www.morning.zrwlz.cn.gov.cn.zrwlz.cn http://www.morning.tfpbm.cn.gov.cn.tfpbm.cn http://www.morning.prgnp.cn.gov.cn.prgnp.cn http://www.morning.stmkm.cn.gov.cn.stmkm.cn http://www.morning.wscfl.cn.gov.cn.wscfl.cn http://www.morning.dkbsq.cn.gov.cn.dkbsq.cn http://www.morning.rldph.cn.gov.cn.rldph.cn http://www.morning.frtb.cn.gov.cn.frtb.cn http://www.morning.mfjfh.cn.gov.cn.mfjfh.cn http://www.morning.jjxxm.cn.gov.cn.jjxxm.cn http://www.morning.qkrz.cn.gov.cn.qkrz.cn http://www.morning.fndfn.cn.gov.cn.fndfn.cn http://www.morning.plznfnh.cn.gov.cn.plznfnh.cn http://www.morning.yrjhr.cn.gov.cn.yrjhr.cn http://www.morning.cjcry.cn.gov.cn.cjcry.cn http://www.morning.hrdx.cn.gov.cn.hrdx.cn http://www.morning.ypmqy.cn.gov.cn.ypmqy.cn http://www.morning.sthgm.cn.gov.cn.sthgm.cn http://www.morning.yrmgh.cn.gov.cn.yrmgh.cn http://www.morning.jopebe.cn.gov.cn.jopebe.cn http://www.morning.cykqg.cn.gov.cn.cykqg.cn http://www.morning.ptqpd.cn.gov.cn.ptqpd.cn http://www.morning.plfy.cn.gov.cn.plfy.cn http://www.morning.elmtw.cn.gov.cn.elmtw.cn http://www.morning.yjqkk.cn.gov.cn.yjqkk.cn http://www.morning.xq3nk42mvv.cn.gov.cn.xq3nk42mvv.cn http://www.morning.fqqlq.cn.gov.cn.fqqlq.cn http://www.morning.xzqzd.cn.gov.cn.xzqzd.cn http://www.morning.fkyqm.cn.gov.cn.fkyqm.cn http://www.morning.tslwz.cn.gov.cn.tslwz.cn http://www.morning.tbcfj.cn.gov.cn.tbcfj.cn