I have an excel program that will retrieve data from websites and place it into an excel spreadhseet ... however, it only works with table data. The sites I need to retrieve the data from are using DIV tags and i'm finding it hard to just grab that info.
The excel module uses the following:
with the code TablesOnlyFromHTML, it will grab the data in the table and place it where I need it. However, if I use False, it grabs all the data on the page and with that, it's hard to get just what I need.Code:Sub ImportDataWeb() Sheets("Website Data").Activate i = 1 Do Until Sheets("Hyperlinks Here").Cells(i, 2) = "" myquery = Sheets("Hyperlinks Here").Cells(i, 2) Sheets("Website Data").Cells(1, 1) = myquery myrow = Sheets("Website Data").UsedRange.Rows.Count + 1 Do myrow = myrow - 1 Loop Until Sheets("Website Data").Cells(myrow, 1) <> "" myrow = myrow + 3 With Sheets(3).QueryTables.Add(Connection:= _ "URL;" & myquery, Destination:=Sheets(3).Cells(myrow, 1)) .BackgroundQuery = True .TablesOnlyFromHTML = True .Refresh BackgroundQuery:=False .SaveData = True End With i = i + 1 Loop End Sub
Anyone have any ideas?



LinkBack URL
About LinkBacks
Reply With Quote


Bookmarks