我嘗試了兩種 VBA XML 方法來登錄 USGA 網站,看起來很簡單,但都不起作用?!要對此進行測試,您將需要自己的 GHIN 號碼和姓氏。有人可以指出我是如何搞砸的嗎?網站=“ https://www.ghin.com/login ”Sub Get_GHIN_Data()Dim request As ObjectDim response As StringDim html As New HTMLDocumentDim website As StringDim price As Variantwebsite = "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.sendresponse = 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).submitEnd Sub
- 0 回答
- 0 關注
- 126 瀏覽
添加回答
舉報
0/150
提交
取消