Here I am trying to replicate one issue I am facing in my secured network using a live example so that some one can help me to find a solution for this.
In fact I open one question (VBA: How to click a drop down in a web page with the help of HREF and CLASS HTML tag avilable ) for the same issue but I cant find a solution yet.
Expected result: The code which help me to open a web page (https://www.amazon.in/) and navigate to a dropdown (Today's Deal) from a menu bar using HTML tag CLASS and HREF only. [The sample (website) give here have "tabindex" as well but please dont use that as a solution because in my really scenario I dont have any other tags other than href & class (Please find the screen shot of HTML tags I have for the real webpage)]
Img1: Real scenario, just keep it here to make you understand that I only have these two tags
The VBA code
Sub Click_aLinkorDropdown()
Dim MyHTML_Element As IHTMLElement
Dim MyURL As String
'On Error GoTo Err_Clear
MyURL = "https://www.amazon.in/"
Set MyBrowser = New InternetExplorerMedium
MyBrowser.Silent = True
MyBrowser.navigate MyURL
MyBrowser.Visible = True
For Each MyHTML_Element In HTMLDoc.getElementsByClassName("nav-a")
If InStr(MyHTML_Element.href, "/gp/goldbox/ref=nav_cs_gb") Then
MyHTML_Element.Click
Exit For
Next
'Err_Clear:
'If Err <> 0 Then
'Err.Clear
'Resume Next
'End If
End Sub
HTML TAG
href='/gp/goldbox/ref=nav_cs_gb' class='nav-a' tabindex='22'>Today's Deals</a><a
Issue I am facing by using this code The web page open and when it reach to click the link I am getting two types of error 1: > Runtime error 438: Object does not support this property or method
2: > Runtime error 424: Object required
And i also tried one of the post available in StackOverflow but this is not working for me