I want the brand name to be extracted from a table, in a website in my excel sheet. There's this table which has information about the product's warranty, shipping and brand, which is under one single "div" element. So I'm unable to extract only the brand name, instead it extracts all the data from the table. I tried my best to code, and I think it would be solved by using IntStr or Mid function, but don't know how to use it here.
Code:
For Each objDiv In doc.getElementsByTagName("div") If objDiv.ID = "CenterPanelInternal" Then
For Each objh1 In objDiv.getElementsByTagName("h1")
If objh1.className = "it-ttl" Then
ThisWorkbook.Worksheets("Sheet1").Range("A1:N1").Value = objh1.outerText
End If
Next
For Each objdiv2 In objDiv.getElementsByTagName("div")
If objdiv2.className = "u-flL w29 vi-price" Then
ThisWorkbook.Worksheets("Sheet1").Cells(3, 1).Value = objdiv2.outerText
End If
Next
End If
If objDiv.ID = "viTabs" Then
For Each objdiv3 In objDiv.getElementsByTagName("div")
If objdiv3.className = "itemAttr" Then
ThisWorkbook.Worksheets("Sheet1").Cells(3, 2).Value = objdiv3.outerText
End If
Next
End If
Next