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

我尝试了两种 VBA XML 方法来登录 USGA 网站,看起来很简单,但都不起作用?!要对此进行测试,您将需要自己的 GHIN 号码和姓氏。有人可以指出我是如何搞砸的吗?

网站=“ 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


肥皂起泡泡
浏览 89回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5