How to click on this button using Internet Explorer DOM. This does not have ID and I do not have IT background.
<button class="btn btn-primary pad-l-50 pad-r-50" onclick="location.href='//return.gst.gov.in/returns/auth/dashboard'" type="button"><span title="Return Dashboard">Return Dashboard</span> <i class="fa fa-angle-right"></i></button>
Please guys also check my previous post which has gone unanswered as on date.
Much appreciated!
Click on Webpage button not having ID
Re: Click on Webpage button not having ID
Try something like:
The 0 might need to be changed to something else if there are multiple buttons with that class name. The one with 0 would be the first.
Code: Select all
wb.document.getElememtsByClassName("btn btn-primary pad-l-50 pad-r-50")[0].Click()
The 0 might need to be changed to something else if there are multiple buttons with that class name. The one with 0 would be the first.
Re: Click on Webpage button not having ID
You can use getElementsByTagName("button") and you get whole range of buttons if page has only one button you can click on it by doing getElementsByTagName("button")[0].click() same thing you can perform using getElementsByClassName, doing getElementsByTagName("button")[0].innerText will get you the innerText and you can now loop through innerText and when innerText matched make your code click on that element
following code doing above stuff using while loop
following code doing above stuff using while loop
Code: Select all
While ( wb.document.getElementsByTagName("button")[ A_Index - 1].InnerText != "Return Dashboard" )
i := A_Index
wb.document.getElementsByTagName("button")[ i ].click()
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory