|
下面是我写的一个函数,你拿去参考吧,如果不会就不用再问了,函数里面该有的提示都有了,这个对象叫xmlhttp,你可以上网找个教程看看他的方法。
Private Function check(url)
Set xmlhttp_obj = createobject("microsoft.xmlhttp")
xmlhttp_obj.open "get",url,False
xmlhttp_obj.send
MsgBox xmlhttp_obj.readystate &xmlhttp_obj.status
If xmlhttp_obj.readystate <> 4 Then
MsgBox xmlhttp_obj.readstate
Else
If xmlhttp_obj.status>=200 And xmlhttp_obj.status<300 Then
Stream.writeline url&" valided"
content=xmlhttp_obj.responsetext
'MsgBox content
Set re = New RegExp
re.Pattern = "<A HREF\=\D?(\/[a-z]+)+"
re.Global = True
re.IgnoreCase = True
Set matches = re.execute(content)
For each match in matches
cutstring=Right(match,match.length-13)
newurl=url&cutstring
MsgBox Newurl
check Newurl
Next
End If
End If
End Function |
|