First time post, I apologize if the answer is actually obvious.
I did some searching, and, through this post and some Googling, managed to assemble this VBA macro for Excel:
Sub GetFeats()
Dim SourceCell As Range
Dim FeatText As String
Dim TargetCell As Range
Dim appIE As Object
Set appIE = CreateObject("internetexplorer.application")
Visible = True
For Each SourceCell In Sheets("Sheet2").Range("A2:A3200")
With appIE
.Navigate SourceCell
.Visible = True
End With
Do While appIE.Busy
DoEvents
Loop
FeatText = appIE.document.getElementById("content")
For Each TargetCell In Sheets("Sheet2").Range("B2:B3200")
b2 = TargetCell
Next TargetCell
Next SourceCell
End Sub
Now, it seems to, well, almost work. I can see Internet Explorer running down the A2:A3200 range, opening up each link in succession. It fails when it gets to an empty cell, so, I'm going to need to search for a way to tell it to skip a cell if the cell is empty, but I think I can manage that on my own.
The problem, is that it's not finding the "content" of the webpage. I'm wondering if maybe div id
is not the same, functionally, as tr id
(as used in the original post I sourced). I think, if I can get the VBA to find the correct content, it will paste it properly, in range B2:B3200, but right now it just pasting "[object HTMLDivElement]"
For context, here is a sample of one of the links that is being pulled from A2:A3200.
Thank-you all in advance.