URL filtering gadget extracts link addresses in Web pages _vbs

Source: Internet
Author: User
How to: Save the following code as Jb51.vbs
Then drag your saved on the local HTM page, drag and drop it on this VBS
Copy Code code as follows:

' Remarks: URL filter gadget
' Prevents errors from occurring
On Error Resume Next
' VBS code starts----------------------------------------------
Dim P,s,re
If wscript.arguments.count=0 Then
Msgbox "Please drag the webpage to the icon of this program!" ",," Tips "
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 "This Web page file does not appear in the URL!" ",," Tips "
End If
Set matches = Re. Execute (s)
S= ""
For the Match in matches
S=s & "<a href=" "& Match.value &" ">" & Match.value & "<p>"
Re. Pattern= "&\w+;?| \w{5,} "
S=re. Replace (S, "")
. Position=0
. SetEOS
. SaveToFile P & "' s urls.html", 2
. Close
End With
Msgbox "URL list has been generated! ",," succeeded "

' VBS code END----------------------------------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.