[英]My vba IE scraper program won't click the go button for some reason
so I'm trying to learn how to interact with html using vba and I'm using this code: 所以我正在尝试学习如何使用vba与html交互,并且正在使用以下代码:
Sub IEScraper()
Dim ie As InternetExplorer
Dim link As HTMLLinkElement
Set ie = New InternetExplorer
ie.Visible = True
ie.navigate ("duckduckgo.com")
Do While ie.Busy = True Or ie.READYSTATE <> 4
DoEvents
Loop
ie.document.getElementById("search_form_input_homepage").Value = _
Sheets(1).Range("A1").Value
ie.document.getElementById("search_form_input_homepage").Click
End Sub
It works up until the click line, where the page just won't click. 直到点击线(页面不会被点击),它才会起作用。 No error pops up and the code ends but the button won't be clicked. 没有错误弹出,代码结束,但是不会单击该按钮。 Is there something I'm doing wrong? 我做错了什么吗?
尝试
ie.document.getElementById("search_button_homepage").Click
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.