Hello
I am trying to make a web scraping macro in order to get stock information from a website based on the stock's registration number (ISIN number)
Here is what I have so far:
Sub Get_Stock_Data()
Dim Page As New XMLHTTP60
Dim Doc As New HTMLDocument
Dim inputbox As IHTMLElement
Dim Table As IHTMLElement
Dim cel As IHTMLElement
Page.Open "get", "URL", False
Page.send
Doc.body.innerHTML = Page.responseText
Set inputbox = Doc.getElementById("searchTextTop")
inputbox.Value = "US0378331005"
Set Table = Doc.getElementsByTagName("table")(1)
For Each cel In Table.getElementsByTagName("td")
Debug.Print cel.tagName, cel.className, cel.getAttribute("link")
Next
End Sub
The ISIN number is being input into the search box on top of the page. After inserting the ISIN number an autocomplete table is generated, which contains the necessary query string that is needed in order to navigate to the stock's main page.
What I need is to get the "innerText" from the "link" attribute of the second <td> tag, however upon running the macro it returns that value as "null". The HTML code generated from the website is in the attached word file.
Would be great if someone could help out.
Thx in advance!
Bookmarks