I have this function:
Sub CreateDatabase()
Dim ieNewPage As InternetExplorer, TableRows As Object, TableRow As Object
Dim TableRowsSpecificOwner As Object, TableRowSpecificOwner As Object, TagNeeded As Object
Set TableRows = GetData()
Set ieNewPage = New InternetExplorer
For Each TableRow In TableRows
ieNewPage.navigate CStr(TableRow.href)
Do While ieNewPage.ReadyState <> 4
DoEvents
Loop
ieNewPage.Visible = True
Set TableRowsSpecificOwner = ieNewPage.document.querySelectorAll("tr[class='puce_texte']")
For Each TableRowSpecificOwner In TableRowsSpecificOwner
If Excel.Application.IfError(Excel.Application.Search("France", TableRowSpecificOwner.innerText), -1) > 0 Then
Debug.Print TableRow.innerText
Debug.Print TableRowSpecificOwner.getElementsByTagName("a")(1).innerText
End If
Next
Excel.Application.Wait (Now + TimeValue("0:00:02"))
Next
End Sub
What it should to do is loop through the hrefs I get with the function GetData(), navigate the page, get some data and move to the next one.
This works for the first link but then I receive the error 462:
The remote server does not exists or is unavailable.
The error is on this line:
ieNewPage.navigate CStr(TableRow.href)
How the heck do I solve this?
<a class="classname" href="link I need">Text info I also need </a>typename(TableRows)and tell us what type name do you get.DispHTMLElementCollection