400-809-6709
RH98 · 最新动态

asp获取a连接,获取代码中的链接地址,asp截取文本连接地址。

来源:瑞恒网络 浏览:
asp获取a连接,获取代码中的链接地址,asp截取文本连接地址。

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网站建设的截取连接地址功能,你学会了吗?


 

← 北京网站建设技术答疑怎么禁止查看网页源文件代码和网页防复制代码
返回动态列表

准备好重塑网站让生意找上门了吗?

免费提供出海网站可行性评估与 AI 排名和 SEO 诊断报告