Disclosure: I'm an office clerk trying to automate the most boring copy-paste part of my job and have 0 knowledge of VBA or HTML. Thank you for your patience with me.
I was able to successfully parse data from intranet page, that I require, by using GetElementByID, however, this particular piece of information doesn't have ID.
I tried getting it using GetElementsByClassName, but it produced error above and I can't figure out why. It seems to work for other people, not for me.
This is my code.
Sub ExtractFromEndeca()
Dim ie As InternetExplorer
Dim html As IHTMLDocument
Dim DescData As MSHTML.IHTMLElementCollection
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = False
ie.Navigate Range("h3")
While ie.Busy
DoEvents
Wend
While ie.ReadyState < 4
DoEvents
Wend
Set doc = CreateObject("htmlfile")
Set doc = ie.document
Set DescData = doc.getElementsByClassName("propertyList")
Set Data = doc.getElementById("findSimilarOptions2")
Sheet3.Cells(1, 1) = Data.innerText
Sheet3.Cells(100, 1) = DescData.innerText
ie.Quit
Set ie = Nothing
End Sub
This is a fragment of HTML from intranet page, that I require.
<table class="propertyList" cellpadding="0" cellspacing="0" width="100%">
<thead>
<th width="60px"> </th>
<th align="left" colspan=1 width="130px" nowrap>Item Information</th>
<th> </th>
</thead>
<tr>
<td rowspan=6 valign=top width="60px"><a href="Wierd looking link"><img border=0 alt="Locate Item" src="Wierd Gif"></a>
</td>
<td valign=top nowrap><b>Property(1)</b></td>
<td>Value(1)</td>
</tr>
<tr>
<td nowrap><b>Property(2)</b></td>
<td>Value(2)</td>
</tr>
<tr>
<td nowrap><b>Property(3)</b></td>
<td>Value(3)</td>
</tr>
<tr>
<td nowrap><b>Property(4)</b></td>
<td>Property(4)</td>
</tr>
<tr>
<td nowrap><b>Property(5)</b></td>
<td>Value(5)</td>
</tr>
<tr>
<td nowrap><b>Property(6)</b></td>
<td>Value(6)</td>
</tr>
</table>
findSimilarOptions2in your example.