'備注:URL篩選小工具
'防止出現(xiàn)錯(cuò)誤
On Error Resume Next
'vbs代碼開(kāi)始----------------------------------------------
Dim p,s,re
If Wscript.Arguments.Count=0 Then
Msgbox "請(qǐng)把網(wǎng)頁(yè)拖到本程序的圖標(biāo)上!",,"提示"
Wscript.Quit
End If
For i= 0 to Wscript.Arguments.Count - 1
p=Wscript.Arguments(i)
With CreateObject("Adodb.Stream")
.Type=2
.Charset="GB2312"
.Open
.LoadFromFile=p
s=.ReadText
Set re =New RegExp
re.Pattern= "[A-z]+://[^"">()\s']+"
re.Global = True
If Not re.Test(s) Then
Msgbox "該網(wǎng)頁(yè)文件中未出現(xiàn)網(wǎng)址!",,"提示"
Wscript.Quit
End If
Set Matches = re.Execute(s)
s=""
For Each Match In Matches
s=s "a href=""" Match.Value """>" Match.Value "p>"
Next
re.Pattern= "\w+;?|\W{5,}"
s=re.Replace(s,"")
.Position=0
.setEOS
.WriteText s
.SaveToFile p "'s URLs.html",2
.Close
End With
Next
Msgbox "網(wǎng)址列表已經(jīng)生成!",,"成功"
'vbs代碼結(jié)束----------------------------------------------
到此這篇關(guān)于URL 篩選小工具 提取網(wǎng)頁(yè)中的鏈接地址的文章就介紹到這了,更多相關(guān)提取網(wǎng)頁(yè)中的鏈接地址內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!