VBA javascript onlick
我一直在尝试调整代码来获得这个工作,但没有成功。 我需要提交以下网页:
<div class="lotusBtnContainer"> <input type="submit" class="lotusBtn" value="Access as a Guest"onclick="javascript:asGuest();"> <input type="submit" class="lotusBtn" value="Log in and Access" onclick="javascript:asUser();"> <span class="lotusAction"> </span> </div>
这是我到目前为止,因为button没有ID我不知道如何解决它:
Dim IntExpl As Object Set IntExpl = CreateObject("InternetExplorer.Application") With IntExpl .navigate "webpage url" .Visible = True Do Until IntExpl.readyState = 4 Loop '.document.getElementsByName("subAction")(0).Click End With End Sub
这工作。
昏暗的IntExpl作为对象
Set IntExpl = CreateObject("InternetExplorer.Application") With IntExpl .navigate "https://febontap.victoria.ibm.com/forms/anon/org/notify/guestselection.html?originatingUrl=..%2f..%2f..%2flanding%2forg%2fapp%2ff373ed45-3637-4662-8fb8-a40a0bd621db%2flaunch%2findex.html%3fform%3dF_Form1&guest=..%2fapp%2ff373ed45-3637-4662-8fb8-a40a0bd621db%2flaunch%2findex.html%3fform%3dF_Form1&user=..%2f..%2f..%2fsecure%2forg%2fapp%2ff373ed45-3637-4662-8fb8-a40a0bd621db%2flaunch%2findex.html%3fform%3dF_Form1" .Visible = True Do Until IntExpl.readyState = 4 Loop .document.getElementsByClassName("lotusBtn")(0).Click End With