你要的 xls 在这里,保存为 test.hta 运行即可:- <script src=http://data.eastmoney.com/zrz/data.aspx?type=dx&style=zf&page=1&pageSize=1850&sortType=G&sortRule=-1&jsname=wKPapAYy&rt=47514817></script>
- <script src=http://www.bathome.net/lib/xdate.js></script>
-
- <script>
- xls = ['股票代码\t股票简称\t相关链接\t发行方式\t发行总数(万股)\t发行价格\t最新价\t发行日期\t增发上市日期\t锁定期']
- var data = wKPapAYy.data
- for(var i=0;i<data.length;i++){
- var I = data[i].split(",");
- var z = I[0],
- y = I[1],
- r = (I[4] == "") ? "-" : I[4],
- l = (I[5] == "") ? "-" : I[5],
- a = (isNaN(I[7]) || I[7] == "") ? I[7] : parseFloat(I[7]).toFixed(2),
- j = (isNaN(I[8]) || I[8] == "") ? I[8] : parseFloat(I[8]).toFixed(2),
- w = (I[9] == "" || I[9] == "-") ? "-" : new XDate(Date.parse(I[9].replace(/-/ig, "/"))).toString("MM-dd"),
- t = (I[11] == "" || I[11] == "-") ? "-" : new XDate(Date.parse(I[11].replace(/-/ig, "/"))).toString("MM-dd"),
- _sdq = I[14] == "" ? "&-" : I[14],
- _hq_link = "http://quote.eastmoney.com/" + z + ".html"
-
- xls.push([z,y,_hq_link,r,l,a,j,w,t,_sdq].join('\t'))
- }
-
- var fso = new ActiveXObject('Scripting.FileSystemObject')
- var ts = fso.CreateTextFile('输出.xls',true,true)
- ts.Write(xls.join('\r\n'))
- ts.Close()
-
- alert('Bingo!')
-
- close()
- </script>
复制代码
|