New to navigating with IE. I m trying to go to a site https://www.thetrainline.com/
and tick the Return
button by using element getElementsByID("return").FirstChild.Click
However all this does is bring up the site. It doesn't tick the return option.
Any ideas?
Public Function GetHTML() As String
On Error GoTo ErrorEscape
Dim URL As String
Dim IE As Object: Set IE = CreateObject("InternetExplorer.Application")
Dim HTML As Object
Dim myElement As Object
'Define URL
URL = "https://www.thetrainline.com/"
IE.navigate URL
Application.Wait (Now + TimeValue("0:00:03"))
MsgBox ("IE Loaded")
Set myElement = IE.getElementsByID("return").FirstChild.Click
Exit Function
ErrorEscape:
Set IE = Nothing
Set HTML = Nothing
End Function
P.S. I want many users to be able to use this without having to download something. Hence, why I am not using Selenium.