I have been trying to use VBA to webscrape some data,
however, i have not much success being able to click on the hyperlink or call the onclick function. Help will be very much appreciated. My code is listed below as well
the only HTML information is listed as below
however, i have not much success being able to click on the hyperlink or call the onclick function. Help will be very much appreciated. My code is listed below as well
the only HTML information is listed as below
<tr class="linkable" onclick="window_directory_member('display.php?UidNum=410640'); return false;">
Code:
Sub webscrape()
Dim objIE As InternetExplorer 'special object variable representing the IE browser
Dim aEle As HTMLLinkElement 'special object variable for an <a> (link) element
Dim y As Integer 'integer variable we'll use as a counter
Dim result As String 'string variable that will hold our result link
Dim HTMLElement As Object
Dim html As Object
Set objIE = New InternetExplorer
objIE.Visible = True
objIE.FullScreen = False
objIE.navigate "https://www.theclearinghouse.org/uid-lookup"
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
objIE.Visible = True
objIE.document.getElementsByTagName("iframe")(0).contentDocument.getElementById("UidNum2").Value = "410640"
objIE.document.getElementsByTagName("iframe")(0).contentDocument.getElementById("SubmitUid").Click
End Sub