0
私は会社名をウェブサイトに検索して検索するVBAをまとめています。idがないウェブサイトの検索ボタンを押す
Sub SearchBot()
Dim objIE As InternetExplorer
Dim aEle As HTMLLinkElement
Dim y As Integer
Dim result As String
Set objIE = New InternetExplorer
objIE.Visible = True
objIE.navigate "https://website.com"
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
objIE.document.getElementById("SearchTopBar").Value = Sheets("Sheet1").Range("A2").Value
'click the 'go' button; This line below is what is causing the problem
objIE.document.getElementByClassName("iPadHack Tmbsearchright").Click
' this line is what the button in the website is referencing
'a class="iPadHack tmbsearchright"onclick="document.forms['hello2'].submit();"> </a
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
はTmbsearchright –
ちょうど、それが機能しなかったことにしようとしたように、単に、1つのクラスを使用してみてください。 "ファイル名を指定して実行時エラー「438: オブジェクトはこのプロパティまたはメソッドをサポートしていません" – Sameer
2行を行います。 が、私はエラーを得た '設定しONODE = objIE.document.getElementsByClassName( "Tmbsearchright")(0 ) 'と' oNode.click'です。 '.getElementByClassName'は間違った構文です。あるいは、別の方法で試してみることもできます: 'Set oForm = document.forms.item(" hello2 ")'と 'oForm.submit' – omegastripes