Vbscript 经典ASP:抓取外部网站上的图像URL

Vbscript 经典ASP:抓取外部网站上的图像URL,vbscript,asp-classic,Vbscript,Asp Classic,在经典ASP中,我需要获取一个外部网站并获取所有图像URL,以便能够创建一个缩略图目录 有人有什么脚本可以让我开始吗?这是我的解决方案。它当然可以清洁和拧紧,但它可以: remoteurl = "http://news.yahoo.com" Set http = CreateObject("MSXML2.ServerXMLHTTP.6.0") http.Open "GET", remoteurl, False http.Send Set re = New RegExp re.Pattern

在经典ASP中,我需要获取一个外部网站并获取所有图像URL,以便能够创建一个缩略图目录


有人有什么脚本可以让我开始吗?

这是我的解决方案。它当然可以清洁和拧紧,但它可以:

remoteurl = "http://news.yahoo.com"

Set http = CreateObject("MSXML2.ServerXMLHTTP.6.0")
http.Open "GET", remoteurl, False
http.Send

Set re = New RegExp
re.Pattern = " ]*src=[""'][^ >]*(jpg|png)[""']"
re.IgnoreCase = True
re.Global = True
re.Multiline = True
Set oMatches = re.Execute(http.responseText)
If Not oMatches Is Nothing Then
    If oMatches.Count > 0 Then
    For Each oMatch In oMatches
        If Not oMatches(0).SubMatches Is Nothing Then
            sBodyText = oMatch.value
            sBodyText = replace(sBodyText,"src=""","")
            sBodyText = replace(sBodyText,"""","")
            response.write "<img src="""&sBodyText&""" style=""max-height:10px;""/><br />"
        End If
    Next
    End If
End If
remoteurl=”http://news.yahoo.com"
设置http=CreateObject(“MSXML2.ServerXMLHTTP.6.0”)
http.Open“GET”,remoteurl,False
http.Send
Set re=New RegExp
re.Pattern=“]*src=[“”][^>]*(jpg | png)[“””
re.IgnoreCase=True
re.Global=True
re.Multiline=True
设置oMatches=re.Execute(http.responseText)
如果不是oMatches什么都不是
如果oMatches.Count>0,则
对于oMatch中的每个oMatch
如果不是oMatches(0)。那么子匹配什么都不是
sBodyText=oMatch.value
sBodyText=替换(sBodyText,“src=”“”,“”)
sBodyText=replace(sBodyText,“”,“”)
response.write“
” 如果结束 下一个 如果结束 如果结束
你有什么脚本让我们开始吗?=)