就是這樣。我剛剛運行模擬測試,它的工作原理。試一試。您可以根據需要修改代碼。這是一個明碼。代碼也可以增強。但是,這確實你問什麼
Dim ie As InternetExplorer
Dim doc As HTMLDocument
Sub start()
Dim ran As Range
Dim cel As Excel.Range
Set ran = Worksheets("Sheet1").Range("A1:A4") 'Change Your input range here
For Each cel In ran
If cel.Value <> Empty Then
Set ie = New InternetExplorerMedium 'open iE
ie.navigate ("http://encodertool.com/hexadecimal") 'Navigate to IE
ie.Visible = True
'Wait untill IE is loaded
Do
' Wait till the Browser is loaded
Loop Until ie.readyState = READYSTATE_COMPLETE
Set doc = ie.document
doc.getElementById("input_4").innerText = cel.Value ' Enter input value
test ' Click button
cel.Offset(0, 1).Value = doc.getElementById("output_4").innerText ' save Output value
End If
ie.Quit
Next cel
End Sub
'Click the Decode button
Sub test()
Set cl_button= doc.getElementsByTagName("a")
For Each one In cl_button
If one.getAttribute("onclick") = "ajaxfct('fcts.php','4')" Then
one.Click
Exit For
End If
Next one
End Sub
運行代碼之前,添加引用HTML對象庫&互聯網的控制。還要更改輸入的範圍。我已將它設置爲A1:A4。改變它什麼。確保範圍內沒有空白單元格。此外,如果您不希望瀏覽器顯示集
ie.visible = false
這是一種方法。有很多簡單而有效的方法可以做到這一點
@ user3752399:哇!正如Tim所建議的那樣,如果它不適合訪問該網站,則可以選擇上述答案。 +1爲轉換 – Sriram 2014-10-12 10:38:53
哇:)非常感謝 – user3752399 2014-10-28 11:21:08