VBScript code
'==================================================
'*函数名 : GetHrefFromContent
'*参数说明 : html asp截取文本连接地址。
'*功能简介 : 获取代码中的链接地址
'==================================================
function GetHrefFromContent(html)
Dim Re, match, matchs,strContent,aryNum,aryContent,strUrl
strContent = ""
set Re = new RegExp
re.IgnoreCase =True
re.Global = True
re.Pattern = "<a.*?href=(?:""(.*?)""|(.*?))(?:(?: .*?>)|>)(.*?)</a>"
Set matchs = re.Execute(html)
for each match in matchs
'match.SubMatches(0) 基本 0 可改成数组里的其它成员
strContent = strContent + (match.SubMatches(0)) & "|$|"
next
set matchs = nothing
aryContent = split(strContent,"|$|")
for aryNum = LBound(aryContent) to UBound(aryContent)
strUrl = aryContent(aryNum) '连接地址
next
end function
asp网站建设的截取连接地址功能,你学会了吗?
Copyright © 2010-2021 北京瑞恒天龙科技有限公司 All Rights Reserved | 北京网站建设知名服务商 | 北京网站制作 | 京ICP备11004170号-1 京公网安备110107000463号
地址:北京市海淀区永定路长银大厦B座 非工作时间:15810379666 服务热线:010-89941606 座机:010-89941606 转801/802/803/804 版权所有 盗版必究!