need to click search button on webpage but dont have button id, class name or any value

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&section=5"
Do While ieApp.Busy: DoEvents: Loop

ieApp.document.querySelector("[*******$='action=agent']").Click
End Sub</code>
<code></code><code>

</code>
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Get a collection of button elements using GetElementsByTagName and loop through the collection looking for the button with innerText = "Search".
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,304
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top