I\'m writing VBA code to obtain a ticker symbol from a user, navigate to a website, input the ticker symbol and click the appropriate link.
I researched this StackOv
You could also use a CSS selector of
a.hqt_button[href='javascript:void(0): onclick=HeaderBox.trySubmit()']
The "." means className. [] encloses an attribute. The above says className hqt_button with attribute href with value 'javascript:void(0): onclick=HeaderBox.trySubmit()', inside of an a tag.
CSS query:
Syntax in VBA:
CSS selectors are applied via the .querySelector method of the HTMLDocument.
ie.document.querySelector("a.hqt_button[href='javascript:void(0): onclick=HeaderBox.trySubmit()']").Click