VBA-XML Web登录到USGA GHIN网站-不工作



我尝试了两种VBA XML方法来登录USGA网站,看起来很简单,但都不起作用?!为了测试这一点,你需要自己的GHIN号码和姓氏。有人能指出我是怎么搞砸的吗?

website="https://www.ghin.com/login">

Sub Get_GHIN_Data()
Dim request As Object
Dim response As String
Dim html As New HTMLDocument
Dim website As String
Dim price As Variant
website = "https://www.ghin.com/login"
Set request = CreateObject("MSXML2.XMLHTTP")
request.Open "GET", website, False
'request.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
request.send
response = StrConv(request.responseBody, vbUnicode)
html.body.innerHTML = response
'********* Method 1 ************************************
'Dim oLogin As Object, oPassword As Object
'Set oLogin = .document.getElementsByName("ghinNumber")(0)
'Set oPassword = .document.getElementsByName("lastName")(0)
'oLogin.Value = ghinNumber  'real GHIN NUMBER
'oPassword.Value = LastName   'real Last Name
'html.document.forms(0).submit
'********* Method 2 ************************************
'html.getElementById("ghinNumber").Value = "ghinNumber"  'real GHIN NUMBER
'html.getElementById("lastName").Value = "Last name"      'real Last Name
'html.getElementClassName("btn fill cardinal").Click
'html.forms(0).submit
End Sub

你试过这种方法吗?我认为它会起作用。

Sub GetInformation()
Const Url = "https://api2.ghin.com/api/v1/public/login.json?"
Dim Http As New XMLHTTP60, ghinNum$, lastName$
ghinNum = ""            'put your ghinNum here
lastName = ""           'put your lastName here
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
End With
MsgBox Http.responseText
End Sub