pwb click on element help Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
HIAC
Posts: 111
Joined: 11 Oct 2017, 17:59
Location: Republic of Serbia

pwb click on element help

06 Nov 2017, 17:46

Hey, I've ran into a problem

Code: Select all

#SingleInstance, Force

LoginPassword := "admin"

pwb := ComObjCreate("InternetExplorer.Application")  ;// Create an IE object
pwb.Visible := true                                  ;// Make the IE object visible
pwb.Navigate("http://192.168.0.1/login.asp")
while pwb.busy or pwb.ReadyState !=4
	sleep, 100
Password_input := pwb.document.getElementById("Password")
Password_input.value := LoginPassword

pwb.document.getElementById("???????????").click()

There is no Name or ID in element, at least I can't find it, however I have Inner text which is "OK" and Index is "28".. How can I click on that button?
Thanks!
User avatar
boiler
Posts: 6120
Joined: 21 Dec 2014, 02:44

Re: pwb click on element help  Topic is solved

06 Nov 2017, 19:37

You could use something else it has associated with it like a tag, for which you would use getElementsByTagName. There will be an array of them, then you need to determine which one it is and define that one, such as getElementsByTagName("a")[0] for the first one, [1] for the second one, etc.
HIAC
Posts: 111
Joined: 11 Oct 2017, 17:59
Location: Republic of Serbia

Re: pwb click on element help

06 Nov 2017, 20:20

That helped me, thank you.
By the way, is there a way to get URL address of element/button?
User avatar
boiler
Posts: 6120
Joined: 21 Dec 2014, 02:44

Re: pwb click on element help

06 Nov 2017, 20:22

I wasn't aware there is a URL address down to an element, so I wouldn't know how.

Return to “Ask For Help”

Who is online

Users browsing this forum: Albireo, aldrinjohnom, bushez, gibenedek, Google [Bot], mgroen, Rohwedder, Xtra and 50 guests