1. 教你asp獲取A標簽下的地址和標題

      2010-12-04

      VBScript code

      '==================================================

      '*函數(shù)名 : GetHrefFromContent

      '*參數(shù)說明 : html 被提取的html中A代碼

      '*功能簡介 : 提取這部分html代碼中A標簽的連接地址和名稱

      '==================================================

      function GetHrefFromContent(html)

      Dim Re, match, matchs,strContent,aryNum,aryContent,strUrl

      strContent = ""

      set Re = new RegExp

      re.IgnoreCase =True

      re.Global = True

      re.Pattern = ")|>)(.*?)"

      Set matchs = re.Execute(html)

      for each match in matchs

      'match.SubMatches(0) 基本 0 可改成數(shù)組里的其它成員

      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