|
我以前写的一个例子,你拿去看看吧,你的问题不是描述性编程,而是正则表达式
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
Set re = New RegExp
re.Pattern = ""
re.Global = True
re.IgnoreCase = True
Set matches = re.execute(content)
For each match in matches
Next |
|