Ajinkya_1988
New Member
- Joined
- Mar 29, 2019
- Messages
- 3
I am new to this forum ... please solve my below problem: i want to click search button to open new page where i can search but i am unable to click the search button as only button name is given in inspect element code.
below is the element code.<code>
<button type="button" *******="****************='Go?action=agent'">Search</button>
</code>please suggest VBA code to click the search button. sorry but i cant provide the URL as it will not work outside the office.
thanks .
from below code i can login on page and i can go to the page where the search button is there after that i stuck on that page.
<code>
</code>
<code>Sub login_page()
Dim ieApp As InternetExplorer
Dim ieDoc As Object
'create a new instance of ie
Set ieApp = New InternetExplorer
'you don’t need this, but it’s good for debugging
ieApp.Visible = True
'assume we’re not logged in and just go directly to the login page
ieApp.navigate "URL"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.document
'fill in the login form – View Source from your browser to get the control names
With ieDoc.forms(0)
.user.Value = "ID"
.Password.Value = "Password"
.submit
End With
ieApp.navigate "http://ts2.bb.noc.sony.co.jp/inmsf/Report?action=view"
Do While ieApp.Busy: DoEvents: Loop
'Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
ieApp.navigate "http://ts2.bb.noc.sony.co.jp/inmsf/Report?action=run"
Do While ieApp.Busy: DoEvents: Loop
ieApp.navigate "http://ts2.bb.noc.sony.co.jp/inmsf/Report?action=run&category=interfaces&template=base%2Frouterprotocols§ion=5"
Do While ieApp.Busy: DoEvents: Loop
ieApp.document.querySelector("[*******$='action=agent']").Click
End Sub</code>
<code></code><code>
</code>
below is the element code.<code>
<button type="button" *******="****************='Go?action=agent'">Search</button>
</code>please suggest VBA code to click the search button. sorry but i cant provide the URL as it will not work outside the office.
thanks .
from below code i can login on page and i can go to the page where the search button is there after that i stuck on that page.
<code>
</code>
<code>Sub login_page()
Dim ieApp As InternetExplorer
Dim ieDoc As Object
'create a new instance of ie
Set ieApp = New InternetExplorer
'you don’t need this, but it’s good for debugging
ieApp.Visible = True
'assume we’re not logged in and just go directly to the login page
ieApp.navigate "URL"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.document
'fill in the login form – View Source from your browser to get the control names
With ieDoc.forms(0)
.user.Value = "ID"
.Password.Value = "Password"
.submit
End With
ieApp.navigate "http://ts2.bb.noc.sony.co.jp/inmsf/Report?action=view"
Do While ieApp.Busy: DoEvents: Loop
'Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
ieApp.navigate "http://ts2.bb.noc.sony.co.jp/inmsf/Report?action=run"
Do While ieApp.Busy: DoEvents: Loop
ieApp.navigate "http://ts2.bb.noc.sony.co.jp/inmsf/Report?action=run&category=interfaces&template=base%2Frouterprotocols§ion=5"
Do While ieApp.Busy: DoEvents: Loop
ieApp.document.querySelector("[*******$='action=agent']").Click
End Sub</code>
<code></code><code>
</code>