Skip to content Skip to sidebar Skip to footer

Usga - Ghin 2nd Page Information - Get The Info From A 2nd Web Page After An Xml Log In

I got excellent help from 'asmitu' who helped me log-in to the USGA GHIN site with the following code. However, my real end problem was to log-In and then maneuver to this 2nd UR

Solution 1:

The content of that target page generates dynamically, so you can't parse the required fields using xhr. However, the following attempt should lead you grab the json response having required fields within it.

Sub GetInformation()
    Const Url = "https://api2.ghin.com/api/v1/public/login.json?"
    Const Link = "https://api2.ghin.com/api/v1/followed_golfers/"
    Dim Http As New XMLHTTP60, ghinNum$, lastName$

    ghinNum = ""
    lastName = ""

    With Http
        .Open "GET", Url & "ghinNumber=" & ghinNum & "&lastName=" & lastName & "&remember_me=false", False
        .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
        .setRequestHeader "Referer", "https://www.ghin.com/login"
        .send
        .Open "GET", Link & ghinNum & ".json", False
        .send
    End With

    MsgBox Http.responseText
End Sub

Post a Comment for "Usga - Ghin 2nd Page Information - Get The Info From A 2nd Web Page After An Xml Log In"