IE VBA打开网页等于单击第一个网页链接 [英] IE VBA open web page equal to clicking on first web page link
问题描述
我正在尝试使用Internet Explorer和MS-Access VBA在一系列网页上自动填写交易.我已经做了很多,但是却被困在这两页上.我使用的是这样的代码:
I'm trying to automate filling in a transaction on a series of web pages using Internet Explorer and MS-Access VBA. I've done quite a bit of this, but am stumped on this one pair of pages. I using code like this:
Set htmlDoc = ie.Document
With htmlDoc
Set e = .getElementById("j_idt31_data")
If e Is Nothing Then GoTo FileAppeal_Error
Set elems = e.getElementsByClassName("ui-widget-content ui-datatable-odd ui-datatable-selectable")
For Each e In elems
If InStr(1, e.innerText, "Evans ") > 0 Then
e.Click
Exit For
End If
Next
结尾
我从此页面开始: https://boe.shelbycountytn.gov/eFile/taxrep.xhtml , 单击左侧的单选按钮之一,然后单击[提交],将我带到 https://boe.shelbycountytn.gov/eFile/search.xhtml
I start on this page: https://boe.shelbycountytn.gov/eFile/taxrep.xhtml, click on one of the radio buttons on the left, then click on [Submit], which takes me to https://boe.shelbycountytn.gov/eFile/search.xhtml
但是我不知道如何以编程方式使[Submit]按钮成功.当我以编程方式单击它时,会收到需要纳税代表"错误消息.
But I can't figure out how to programmatically get the [Submit] button to succeed. When I programmatically click on it I get a "Tax Rep is Required" error message.
建议深表感谢.
推荐答案
I did this using selenium basic. Download then add the selenium type library reference.
Option Explicit
Public Sub test()
With New ChromeDriver
.Start "Chrome"
.Get "https://boe.shelbycountytn.gov/eFile/taxrep.xhtml"
.FindElementByCss("span.ui-radiobutton-icon.ui-icon.ui-icon-blank").Click
.FindElementByCss("span.ui-button-text.ui-c").Click
'other code
Stop
.Quit
End With
End Sub
这篇关于IE VBA打开网页等于单击第一个网页链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!