建站知识

Welcome to Beijing RuiHeng TianLong Technology Co., Ltd.

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


 

本文TAG标签: asp网站制作 asp网站建设
返回关闭本页
上一篇:北京网站建设技术答疑怎么禁止查看网页源文件代码和网页防复制代码    下一篇:在打开网站时显示的如404,500等错误提示是什么意思,网站制作中HTTP常见状态代码
推荐阅读

Copyright © 2010-2021 北京瑞恒天龙科技有限公司  All Rights Reserved  |  北京网站建设知名服务商  |  北京网站制作 | 京ICP备11004170号-1   京公网安备110107000463号
地址:北京市海淀区永定路长银大厦B座  非工作时间:15810379666  服务热线:400-809-6709  版权所有 盗版必究!

在线咨询
关闭
电话咨询
网站制作电话
400-809-6709