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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
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,223,896
Messages
6,175,259
Members
452,626
Latest member
huntinghunter

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