Quote<ul class="dropdown">
<li class="active">Graphite India Ltd</li>
<li >Graphite India Ltd (Merged)</li>
</ul>
Code
Sub SearchScreener()
Dim SearchScreenerElement As HTMLUListElement
Dim IE As SHDocVw.InternetExplorer
Dim HUrl As MSHTML.HTMLDocument
Dim URL As String
URL = "https://www.screener.in/home/"
Set IE = New SHDocVw.InternetExplorerMedium
IE.Visible = True
IE.Navigate URL
' Wait till the Internet Explorer has finished loading
Do While IE.ReadyState <> READYSTATE_COMPLETE
Loop
' Stores a reference to the HTML Document in that variable
Set HUrl = IE.Document
' Wait for document to load
If HUrl.ReadyState = "complete" Then
HUrl.getElementsByTagName("input")(0).Value = "Graphite India Ltd"
Set SearchScreenerElement = HUrl.getElementsByClassName("dropdown").Item(0).getElementsByTagName("li").Item(0)
Debug.Print "SearchScreenerElement : " & SearchScreenerElement.innerText
SearchScreenerElement.Click
EndIf
End Sub
Display More
The class attribute of <ul> changes from "dropdown" to hidden". So, there must be javascript running in the background.
Quote<ul class="hidden">
<li class="active">Graphite India Ltd</li>
<li>Graphite India Ltd (Merged)</li>
</ul>