looking for some solutions? You are welcome.

SOLVED: Why Calling a Number With Cell Name Comes Empty?

Hugues Lin:

if i call


its working

but when i want to take number or another code


=GetElementByRegex(A2,"<!-- Alexa web traffic metrics are available via our API at http://aws.amazon.com/awis -->(.*?)</strong>")

its comes Empty.. i dont know why..i am new one

The code i am using... Thanks

Public Function GetElementByRegex(url As String, reg As String)
Dim XMLHTTP As Object, html As Object, objResult As Object
Set XMLHTTP = CreateObject("MSXML2.serverXMLHTTP")
XMLHTTP.Open "GET", url, False
XMLHTTP.setRequestHeader "Content-Type", "text/xml"
XMLHTTP.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1; rv:25.0) Gecko/20100101 Firefox/25.0"
Set html = CreateObject("htmlfile")
html.body.innerHTML = XMLHTTP.ResponseText
Set regEx = CreateObject("VBScript.RegExp")
regEx.Pattern = reg
regEx.Global = True
If regEx.Test(XMLHTTP.ResponseText) Then
    Set matches = regEx.Execute(XMLHTTP.ResponseText)
    If IsMissing(index) Then
        GetElementByRegex = matches(0).SubMatches(0)
        GetElementByRegex = matches(index).SubMatches(0)
    End If
    Exit Function
End If
GetElementByRegex = ""

End Function

Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots

No comments: