Automate IE webpage booking
Hello,
I am trying to automate an online booking using Excel & VBA. I have little experience with VBA code. So far I am able to open a IE window, click the login drop down button, enter my username & password in the two fields and then click the login button. This process seems to be working fine, however when I get to the second page after login, I'm having trouble clicking another menu button to continue on in the booking. Here is my VBA code:
Code:
Sub GetIE()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "URL Of The Website" '
' Wait while IE loading...
Do
DoEvents
Loop Until IE.ReadyState = 4
'Clicks the SIGN IN button on the main menu - drop down window appears
IE.document.getElementById("sign-in-menu-btn").Click
'Enters the username into username field
IE.document.getElementById("Username").Value = "my_email_address" '
'Enters the Password into Password field
IE.document.getElementById("Password").Value = "my_password"
'clicks SIGN IN after login info
Set AllHyperLinks = IE.document.getElementsByTagName("A")
For Each hyper_link In AllHyperLinks
If hyper_link.href = "javascript:signIn()" Then
hyper_link.Click
Exit For
End If
Next hyper_link
End Sub
The next button that I am trying to click has the HTML code of this:
HTML Code:
<a class="anchorbutton gray vertical" onclick="this.blur();" href="example_link">Book a Tee Time</a>
Thanks for any assistance.