Skip to content

Instantly share code, notes, and snippets.

@ganesh092929
Last active July 24, 2018 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ganesh092929/4f59683c4666714e73ad985557789bb0 to your computer and use it in GitHub Desktop.
Save ganesh092929/4f59683c4666714e73ad985557789bb0 to your computer and use it in GitHub Desktop.
Sub ScrapeCarDataPt2()
Dim IE As InternetExplorer
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "https://carousell.com/categories/cars-32/cars-for-sale-1173/"
Do While IE.ReadyState <> READYSTATE_COMPLETE: Loop
Dim CarListings As IHTMLElementCollection
Dim CarListing As IHTMLElement
Dim ItemName As IHTMLElementCollection
Set CarListings = IE.Document.body.getElementsByClassName("col-lg-3 col-md-4 col-sm-4 col-xs-6")
For Each CarListing In CarListings
Set ItemName = CarListing.getElementsByClassName("A-i")
Debug.Print ItemName(0).innerText
Next CarListing
IE.Quit
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment