首页 > 解决方案 > 将登录详细信息从 VBA 发送到 HTML 弹出窗口

问题描述

是否可以将登录详细信息从 VBA 发送到 HTML 弹出窗口?我很容易调用主 HTML 页面,但随后会出现一个弹出登录窗口,并且我的代码返回错误“远程服务器计算机不存在或不可用”。:

Set appIE = New InternetExplorerMedium
With appIE
    .navigate sURL
    .Visible = True
End With
Do While appIE.Busy Or appIE.readyState <> 4
    DoEvents
Loop
' ERROR OCCURS HERE - "The remote server machine does not exist or is unavailable"
Set objCollection = appIE.document.getElementById("inputUsername")
objCollection.Value = "xxxxx.xxxx@xxx.xxx.xx"
Set objCollection2 = appIE.document.getElementById("inputPassword")
objCollection2.Value = "yyyyyy"

弹出 HTML 是(我已经删掉了一些行):

<div class="input-prepend">
  <label class="add-on " for="inputPassword" data-ng-class="{'text-error': passwordRequired}">Password</label>
  <input name="inputPassword" class="input-medium ng-pristine ng-valid" id="inputPassword" type="password" placeholder="Password" data-ng-model="password">
</div>

标签: htmlexcelvbaweb-scraping

解决方案


推荐阅读