xxx = "t4212"
URL = "http://t4211.bliao.com/?id=" + xxxxmlhttp.Open("GET",URL, false);
URL = "http://t4211.bliao.com/?id=" + xxxxmlhttp.Open("GET",URL, false);
解决方案 »
- extjs4 mvc 怎么初始化(通过调用后台数据)创建toolbar
- jquery用ajax加载的HTML内容里面包含的jquery标签失效
- 问个元素节点内的文本
- Ext datefield的问题,想显示后两天的某一时间
- 奇怪的js问题,html赋值后前面加<?xml:namespace prefix = v>
- 关于javascript在框架当中的一些功能疑问
- 请问大家这段JavaScript的函数有何作用?
- 高分赠送:javascript不支持属性或方法,加一个alert()后正常使用
- 如何只能选择三个复选框,并执行操作动作!
- 我在客户端有一个输入规则校验文件,如何访问它呢?
- 来讨论一下在yaohoo页面执行脚本的问题
- HTC有难度
但我不懂得把得到的代码分析出来例如获取到代码后。 怎么在那一堆代码中分析出 在线人数:(N人) 里面的N人
我获取这个页其实就只是要得到N 其余的都是没有用的也就是怎么分析<td align="center">在线人数:<font color="#ff6600">(2人)</font></td></tr>这段得出N还有 可能刚才表达有错误例如这个XMLHTTP页的名字是 a.asp
那么只要输入a.asp?id=t4211 就是获取 "http://"+id+".bliao.com/"的代码行不?最好能给个立刻能用的代码。没有的话举个例子。听说要用到正则,但正则我还没有掌握的。
下面是ASP实现的
<%
'调用方法,文件名.asp?id=xxxxx
id=request("id")
if id="" then id="t4212"
online=""
contents=getHTTPPage("http://"&id&".bliao.com")
Dim Regex
Set Regex = New Regexp
Regex.Pattern = "<td align=\""center\"">在线人数:<font color=\""#ff6600\"">\((\d+)人\)</font></td>"
Regex.Ignorecase = True
Regex.Global = True
Set Matches =Regex.Execute(contents)
For Each Match In Matches
response.write Match.submatches(0)
Next
Set Matches =Nothing
Set Regex=Nothing
response.write onlineFunction Bytes2Bstr2(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
Bytes2Bstr2 = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
function getHTTPPage(url)
on error resume next
dim http
'set http=Server.createobject("Msxml2.XMLHTTP")
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then exit function
getHTTPPage=bytes2BSTR2(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function
%>
response.write Match.submatches(0)
这行改成
online= Match.submatches(0)-_-'