- 帖子
- 6
- 积分
- 19
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2017-8-6
|
2楼
发表于 2017-9-28 22:07
| 只看该作者
<script>
var fso = new ActiveXObject('Scripting.Filesystemobject');
var StdIn = fso.GetStandardStream(0);
var StdOut = fso.GetStandardStream(1);
function BintoStr(strBin,strCharset){
try{
var stream = new ActiveXObject('ADODB.Stream')
stream.Type = 1
stream.Mode = 3
stream.Open()
stream.Write(strBin)
stream.Position = 0
stream.Type = 2
stream.Charset = strCharset
return stream.ReadText
}
catch(e){}
}
function getHtmlTxt(url){
try{
var http = new ActiveXObject('MSXML2.XMLHTTP')
}
catch(e){
var http = new ActiveXObject('WinHttp.WinHttpRequest.5.1')
}
http.open('get', url, false)
http.send()
try{
var char = /chareset *?= *?([^\s;]+)/i.exec(http.getResponseHeader('content-type'))[1];
var htmltext = BintoStr(http.ResponseBody, char);
}catch(e){
try{
var char = /<meta .*?charset ?= ?\"?([^\s\"]+)/i.exec(http.ResponseText)[1];
var htmltext = BintoStr(http.ResponseBody, char);
}catch(e){
var htmltext = http.ResponseBody?http.ResponseBody:http.ResponseText;
}
}
return htmltext;
}
加上开始这一段 谢谢大神 |
|