28,406
社区成员
发帖
与我相关
我的任务
分享
<title>test</title>
<style>
td{background:#ffffff;width:65px;text-align:center;color:#ff3300;font-size:12px;};
th{background:#dddddd;width:65px;height:24px;text-align:center;color:#555555;font-size:12px;};
</style>
<%
Function GetHtmlCode(url)
Dim HtmlStr
Set HtmlStr = Server.CreateObject("MSXML2.serverXMLHTTP")
HtmlStr.Open "GET",url,False,"",""
HtmlStr.Send
While HtmlStr.readyState <> 4
HtmlStr.waitForResponse 1000
Wend
GetHtmlCode = BytesToBstr(HtmlStr.responseBody,"gb2312")
Set HtmlStr = Nothing
End Function
Function BytesToBstr(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
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
public function findBt(StrMain,StrBegin,StrEnd)
Dim num1,num2,numLen1,numLen2
numLen1 = len(StrBegin)
numLen2 = len(StrEnd)
num1 = InStr(StrMain,StrBegin) + numLen1
num2 = InStr(StrMain,StrEnd) - num1
FindBt = Mid(StrMain,num1,num2)
end function
dim str1,str
str1 = GetHtmlCode("http://forex.jrj.com.cn/list/whbjList.shtml")
str1 = findBt(str1,"<table class=""t3 tfix"">","</table>")
str1 = replace(str1," ","")
str1 = replace(str1," "," ")
str = replace(str1," class=""bd2""","")
str = replace(str,"<a ","<span ")
str = replace(str,"</a>","</span>")
%>
<center>
<textarea style="width:990px;height:200px;">
更改后table代码:
<table><%=str%></table>
</textarea>
<table cellspacing="1" cellpadding="0" border="0" bgcolor="#999999"><%=str%></table>