Cvb6合宝典图库:VBA-Selenium运行时错误 找不到窗口:无法在关闭的窗口上找到元素

关于Cvb6合宝典图库的问题,在cvb manatron中经常遇到, 但是我尝试过,VBA 硒无法在加载的页面中找到现有元素。这是我使用的最后一个代码:

但是我尝试过,VBA 硒无法在加载的页面中找到现有元素。这是我使用的最后一个代码:

Sub TableData()
Dim driver As New WebDriver
Dim sInfo As String
With driver
    .Start "Internet Explorer"
    .Get "http://cvb.manatron.com/Tabs/PropertySearch.aspx"
    .FindElementById("fldInput").SendKeys ("Carter")
    .FindElementById("btnsearch").Click
    sInfo = .FindElementById("grm-search", timeout:=20000).Text
    Debug.Print sInfo
    .Quit
End With
End Sub

希望有人能帮忙。谢谢

2

通过在SendKeys之前添加延迟并尝试检索sInfo,这对我有用。

Option Explicit
Sub TableData()
Dim driver As New WebDriver
Dim sInfo As String
With driver
    .Start "Chrome" '"Internet Explorer"
    .Get "http://cvb.manatron.com/Tabs/PropertySearch.aspx"
 
     Application.Wait Now + TimeValue("00:00:02")
    .FindElementByCss("#fldInput").SendKeys "Carter"
    .FindElementById("btnsearch").Click
     
    Application.Wait Now + TimeValue("00:00:01")
    sInfo = .FindElementById("grm-search", timeout:=20000).Text
    Debug.Print sInfo
    .Quit
End With
End Sub

输出:

Output of search

本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处

(505)
Crush申孝燮身高:iPad:PNG压缩错误
上一篇
函数表格:用数学函数表示函数(3 ways to represent a function)
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(68条)