liambuchanan
New Member
- Joined
- Oct 10, 2018
- Messages
- 4
Good Afternoon,
I am new to this forum and also very new to VBA. For the past few weeks I have been trying to automate pulling data from a company webpage with no luck.
I have got as far as logging on to the webpage, navigating a dealer select drop down and onto the main dashboard. The bit i am facing an issue with is selecting the "MDP Performance" button which is in a frame.
Here is the VBA script I have right now:
Frame Script:
and here is the menu/button script:
Apologies if the above information isnt what is needed!
Many Thanks,
Liam
I am new to this forum and also very new to VBA. For the past few weeks I have been trying to automate pulling data from a company webpage with no luck.
I have got as far as logging on to the webpage, navigating a dealer select drop down and onto the main dashboard. The bit i am facing an issue with is selecting the "MDP Performance" button which is in a frame.
Here is the VBA script I have right now:
Code:
Sub Test()
Dim ieApp As InternetExplorer
Dim ieDoc As Object
Dim html As HTMLDocument
Dim frame As HTMLFrameElement
Dim img As HTMLImg
Set ieApp = New InternetExplorerMedium
ieApp.Visible = True
ieApp.navigate "https://www.motabilityonline.co.uk/IdM/login"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.document
With ieDoc.forms(0)
.UserName.Value = "USERNAME"
.Password.Value = "PASSWORD"
.submit
End With
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.document
With ieDoc.forms(0)
.organisationSelection.Value = "2005"
.submit
End With
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
ieApp.navigate "http://www.motabilityonline.co.uk/OLA/"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.document.frames("menu").document
ieDoc.getElementsByTagName("TR")(0).getElementsByClassName("menubutton")(0).Click
End Sub
Frame Script:
HTML:
<FRAME noResize src="mainMenu.jsp" name=menu scrolling=no>
and here is the menu/button script:
HTML:
<TR><TD class=menupad><TABLE class=menubutton cellSpacing=0 cellPadding=0 border=0><TBODY><TR><TD id=menu_134><A class=menubuttontext style="CURSOR: pointer" href="/OLA/mdpDashboard/secure/pageSelect.do?forward=view" target=body>MDP Performance</A> </TD></TR></TBODY></TABLE></TD></TR>
Apologies if the above information isnt what is needed!
Many Thanks,
Liam