Hi Everyone,
My question is really simple. I want to use VBA to open explorer, navigate to google.com and click on the "Gmail" link in the upper right corner.
I can open explorer and navigate to google, however when I inspect the element for the Gmail link, it does not have an ID. I tried to work into it to no avail using parent IDs and class names. I honestly didn't know what I was doing, but I'll pose the code below anyway. THANKS FOR THE HELP!
![]()
Sub OpenExplorer() Dim IE As Object Set IE = CreateObject("InternetExplorer.Application") Dim link As Object IE.navigate "http://www.google.com" IE.Visible = True While IE.BusyDoEvents Wend 'This is where I attempted to find the link: IE.document.getElementById("gb").getElementsByClassName("gb_Ub gb_Rc").getElementsByClassName("gb_7 gb_Rc gb_h gb_Qc gb_Uc").getElementsByClassName("gb_Cc gb_h gb_Rc gb_Kc").getElementsByClassName("gb_g gb_h").getElementsByClassName("gb_f").Click End Sub
Bookmarks