0
我想從網站拉動信息,但不能爲我的生活弄清楚如何點擊按鈕。我已經有了輸入信息的代碼。這是該網站的HTML。任何幫助,將不勝感激。使用VBA點擊一個按鈕
<p role="button" tabindex="0" class="fmtbutton" onkeypress="finddistancebetweenaandb(document.forms['inp']['pointa'].value,document.forms['inp']['pointb'].value);" onclick="finddistancebetweenaandb(document.forms['inp']['pointa'].value,document.forms['inp']['pointb'].value);"> Show </p>
以下是我到目前爲止的完整代碼。
Sub RoundedRectangle1_Click()
Dim eRow As Long
Dim ele As Object
Dim objIE As Object
Set objIE = CreateObject("InternetExplorer.Application")
FranchiseAddress = Range("B2").Value
Movefrom = Range("B3").Value
moveto = Range("B4").Value
With objIE
.Visible = True
.navigate "https://www.freemaptools.com/how-far-is-it-between.htm"
Do While .Busy Or _
.readyState <> 4
DoEvents
Loop
Set d = .Document.getElementsByName("onoffswitch")
d.Item(0).Click
Set f = .Document.getElementsByName("pointa")
f.Item(0).Value = FranchiseAddress
Set a = .Document.getElementsByName("pointb")
a.Item(0).Value = Movefrom
「這是我堅持」
End With
End Sub
我曾嘗試在此網站上發現了很多問題,多種解決方案,但他們都不工作。
謝謝。
這已被要求,並回答了這麼多次添加到您的代碼。請做研究。然後回來,如果你有代碼,你需要幫助。 – jsotola
我已經嘗試了很多次,從本網站有多個答案。我將用我到目前爲止的代碼進行編輯。 –
那會很好 – jsotola