I'm having a difficult time scraping the elements from a webpage. The webpage source looks something like this
<div class="tb-react-data-grid">
<div class="tb-react-dg-hrow">
<div class="tb-react-dg-body">
<div class="tb-react-dg-bsection">
<div class="tb-react-dg-bsection">
Under each "tb-react-dg-bsection", there are multiple "tb-react-dg-brow" div's, and then finally 4 of these that I need:
<div class="tb-react-dg-bcell" data-tb-test-id="somethingNeeded#1">
<div class="tb-react-dg-bcell" data-tb-test-id="somethingNeeded#2">
<div class="tb-react-dg-bcell" data-tb-test-id="somethingNeeded#3">
<div class="tb-react-dg-bcell" data-tb-test-id="somethingNeeded#4">
I'm trying to grab the displayed text in the "tb-react-dg-bcell" items (somethingINeeded items). I've tried different approaches, but so far it's only grabbing the text in the first 40 or so rows. When you scroll down the webpage, another
<div class="tb-react-dg-bsection">
appears when I'm viewing with F12 in the browser. Here's what I've got so far.
Public Sub Scrape()
Dim ie As InternetExplorerMedium: Set ie = New InternetExplorerMedium
Dim html As HTMLDocument
Dim cRow As Long, source As Object
cRow = 1
With ie
.Visible = True
.Navigate "http://testwebsite.com"
End With
Do While ie.ReadyState <> READYSTATE_COMPLETE
DoEvents
Loop
Set Html = ie.Document
Set mtbl = Html.getElementsByClassName("tb-react-dg-bcell")
For Each source In mtbl
Sheets(1).Cells(cRow, 1) = source.textContent
cRow = cRow + 1
Next source
ie.Quit
Set ie = Nothing
End Sub
Any suggestions on how to grab the remaining rows would be greatly appreciated!
Edit: adding screenshot