I'm fairly new/inexperienced at VBA and I'm (seemingly) one small step from finishing a project that been kicking my butt. For some background, I'm scraping a website and navigating to the appropriate "tbody" tag and iterating through the encompassed "tr" tags. In each tr I am expecting two "td" cells. The problem is the first tr has a "th" tag with a colspan of 2, meaning obviously there is only one child in that tr and the code crashes out. What I don't (yet) know how to do is to skips or account for the exception in the first tr. Here is the relevant snippet of the code:
R = 1
For Each ele In IE.Document.getElementsByTagName("tbody")(13).getElementsByTagName("td")
WSW.Range("H" & R).Value = ele.Children(0).textContent
WSW.Range("I" & R).Value = ele.Children(1).textContent
R = R + 1
Next
Not sure if I've walked myself down a rabbit hole, if the code is salvageable, or if the slate for this section of the code should be recreated. Thank you for any help.
if not ele = "th" then ........... End if R = R + 1 NextJust throwing that out there.