Screen scraping - all text ending up in one cell

bifter

New Member
Joined
Nov 6, 2022
Messages
2
Office Version
  1. 2013
Platform
  1. Windows
Dim ie As New InternetExplorer
Dim doc As HTMLDocument
Dim span As Object
Dim elements As IHTMLElementCollection
Dim element As IHTMLElement

Sheets("Import").Select
Cells.Delete
Range("A1").Select

ie.Visible = True

ie.Navigate "AUCTION(S) SEARCH RESULTS | Rum Auctioneer" & SearchTerms & "&sort=field_reference_field_end_date+DESC&items_per_page=500"

Do
DoEvents
Loop Until ie.readyState = READYSTATE_COMPLETE

Set doc = ie.Document
Set elements = doc.getElementsByClassName("view-content")

For Each element In elements
ActiveCell.Value = element.innerText
ActiveCell.Offset(1, 0).Select
Next element

ie.Visible = False
ie.Quit
Set ie = Nothing

A good example URL might be:


Trying to scrape info from this web site. Whatever I try, span, div, class, element, everything seems to end up written into cell A1. I'd like to have a new line for each item in the grid or even for each innerText item. Can you help please? I'm not that well versed in HTML so I've been bodging so far. Thanks in advance.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Bumping this thread. I haven't had much time to look at this but in the time that I have I haven't found an answer. Any responses appreciated.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top