I have been trying to import the table results from http://avionictools.com/icao.php using example Reg code is N2 my code adds the Reg code and clicks the submit button , but I am unable to copy the results from the table. I wanted the hex code copying to column C
Public Sub regsearch()
Dim LR1, lr2 As Long, i As Long
LR1 = Sheet1.Range("A" & Rows.Count).End(xlUp).Row
Dim data As String
Dim bot As New WebDriver
For i = 2 To 2
Sheet1.Range("A" & i).Copy 'Value is N2
Set clipboard = GetObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
With clipboard
.GetFromClipboard
data = .getText
End With
'MsgBox data
bot.Start "chrome", "http://avionictools.com"
bot.Wait 2000
bot.get "/icao.php"
bot.Wait 2000
bot.FindElementByName("data").Click
bot.SendKeys data
bot.Wait 2000
bot.FindElementByXPath("//div/input").Click
bot.Wait 1000
Set Table = bot.getElementsByTagName("table").Item(0)
For Each Tr In Table.getElementsByTagName("tr")
tdlen = Tr.getElementsByTagName("td").Length
If tdlen > 1 Then
lr = Sheet2.Range("A" & Rows.Count).End(xlUp).Row + 1
Sheet1.Range("C" & i).Value = Tr.getElementsByTagName("td").Item(0).innerText
Sheet1.Range("D" & i).Value = Tr.getElementsByTagName("td").Item(1).innerText
Else
End If
Next Tr
Application.Wait Now + TimeValue("00:00:04")
Next
End Sub