Hi Everyone. i am trying to scrape li tags that shares the same class name
the HTML cods looks like this:
my current code
only writes to cells A1: "sample text# 1"
how can i have all the tags to be written to cell A1?
desired result would be cell A1:
sample text# 1
sample text# 2
sample text# 3
sample text# 4
sample text# 5
Any help will be great
the HTML cods looks like this:
HTML:
<ul class="top-section-list" data-selenium="highlightList">
<li class="top-section-list-item">sample text# 1</li>
<li class="top-section-list-item">sample text# 2</li>
<li class="top-section-list-item">sample text# 3</li>
<li class="top-section-list-item">sample text# 4</li>
<li class="top-section-list-item">sample text# 5</li>
</ul>
my current code
Code:
Sub GetData()
Dim objIE As InternetExplorer
Dim itemEle As Object
Dim data As String
Dim y As Integer
Set objIE = New InternetExplorer
objIE.Visible = True
objIE.navigate "someWebsite"
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
y = 1
For Each itemEle In objIE.document.getElementsByClassName("top-section-list")
data = itemEle.getElementsByTagName("li")(0).innerText
y = y + 1
Next
data = Range("A1").Value
End Sub
only writes to cells A1: "sample text# 1"
how can i have all the tags to be written to cell A1?
desired result would be cell A1:
sample text# 1
sample text# 2
sample text# 3
sample text# 4
sample text# 5
Any help will be great