• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Internet Explorer Automation - Insert value from cell to input and retrieve result

Still can't reach qualoperadora.net … :(

… no matter, back to request via qual-operadora ! :cool:
No protection in fact (despite duplicates ID),
mea culpa, a request header somewhat missing :rolleyes: :​
Code:
Sub DemoXML2a()
             Dim oDoc As Object, oReq As Object
             Set oDoc = CreateObject("HTMLFile")
             Set oReq = CreateObject("MSXML2.XMLHttp")
                   VA = [A1].CurrentRegion.Value
Application.StatusBar = "        Web download …"
   
For R& = 2 To UBound(VA)
    If VA(R, 2) = "" Or Val(VA(R, 2)) Then
        With oReq
            .Open "POST", "http://www.qual-operadora.net/", False
            .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
            .setRequestHeader "DNT", "1"
            On Error Resume Next
            .send "numero=" & VA(R, 1)
            On Error GoTo 0
   
            If .Status = 200 Then
                oDoc.body.innerHTML = .responseText
                  Cells(R, 2).Value = Split(oDoc.forms(1).innerText, vbCrLf & "Quer")(0)
            Else
                  Cells(R, 2).Value = .Status & " : " & .StatusText
                MsgBox "#" & .Status & vbLf & vbLf & .StatusText, vbExclamation, "  Request error :"
                Exit For
            End If
        End With
    End If
Next
        Application.StatusBar = False
Set oDoc = Nothing:  Set oReq = Nothing
End Sub
With these two last codes, you can compare and learn
using webbrowser inspector tool …
 
holy mama hahahaha, that was SO FAST!
Wow. Yea, im definately going to checkout the webbrowser inspector tool.

Thank you Marc! hahahaha wow!
 
Back
Top