如何在MS Access VBA中单击此HTML代码中的提交按钮(没有名称或ID) [英] How can I click the submit button in this HTML code (has no name or ID) with MS Access VBA

查看:251
本文介绍了如何在MS Access VBA中单击此HTML代码中的提交按钮(没有名称或ID)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此HTML页面上的按钮没有名称或ID,因此我无法点击它。我扫描了以前的问题,但没有一个像我能看到的这个HTML。我没有包括整个页面,但是这是带有按钮的部分,我需要点击。

The button on this HTML page doesn't have a name or ID so I am unable to click it. I've scanned the previous questions but none are like this HTML that I can see. I've not included the whole page but this is the section with the button in it that i need to click.

我使用MS Access 2010中的VBA进行制作IE v8。如果这很容易,我仍然在学习如此道歉(希望是这样)。因为您可以看到SUBMIT输入类型没有名称或ID。谢谢。

I'm using VBA from MS Access 2010 to maniupulate IE v8. I'm still learning so apologies if it's easy (hope it is). as you can see the SUBMIT input type has no name or ID. thanks.

</div>
<div id="container">
<div class="group">
    <div id="content">
    <div class="banner">
<h2>Welcome</h2>

<div id="search-box">
    <form method="get">
        <label for="criteria">Search</label>
        <input type="text" id="search" name="search" value="" maxlength="255" />
        <input type="submit" class="button" value="Search" />
    <p class="hint">Search by Order No. Service ID or Your reference ID</p>
    </form>


推荐答案

使用这个:

Dim htmlButton
Set htmlButton = WebBrowser1.Document.GetElementByID("search-box").GetElementsByTagname("Input")(1)

'' Test to see if we got the right element. (Comment out or remove this line later)
MsgBox htmlButton.Value

'' Click that button
htmlButton.Click

这篇关于如何在MS Access VBA中单击此HTML代码中的提交按钮(没有名称或ID)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆