ComObjCreate need help click on a button Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
tm6464
Posts: 48
Joined: 17 Jul 2017, 22:56

ComObjCreate need help click on a button

19 Oct 2018, 15:20

Hi all
i have a problem to click on a button on https://www.ebay-kleinanzeigen.de
Maybe any expert here can help me.

here u can see a pic of the code
https://prnt.sc/l83l7s

this is what i tryed

Code: Select all

WB := ComObjCreate("InternetExplorer.Application")
WB.Visible := true
WB.Navigate("https://www.ebay-kleinanzeigen.de/p-anzeige-aufgeben.html#?path=102/107&isParent=false")
While wb.readyState != 4 || WB.document.readyState != "complete" || wb.busy
Sleep, 1000
WB.document.getElementById("postad-step1-frm").click() ;not work
WB.document.getElementById("postad-step1-sbmt").click() ;not work
WB.document.getElementById("postad-step1-frm").click() ;not work
WB.document.getElementsByTagName("Weiter").click() ;not work
btw if you want to see the button live on this website for testing you need login first
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: ComObjCreate need help click on a button  Topic is solved

19 Oct 2018, 15:54

" you need login first"
as does the web browser ure instantiating, ie. u need to programatically fill in ur login data, press login, wait for the next page to load and only then try to press the 'next' button.
the button is wrapped in a div, wrapped in a form. none of these things uve tried target the button. a straightforward method to obtain a reference to this button is using css selectors:

Code: Select all

wb.document.querySelector("#postad-step1-frm > button.button").click()
tm6464
Posts: 48
Joined: 17 Jul 2017, 22:56

Re: ComObjCreate need help click on a button

19 Oct 2018, 16:16

yes i login first, and login work
the code u send me not press the button

Code: Select all

WB := ComObjCreate("InternetExplorer.Application")
WB.Visible := true
WB.Navigate("https://www.ebay-kleinanzeigen.de/m-einloggen.html?targetUrl=/")
While wb.readyState != 4 || WB.document.readyState != "complete" || wb.busy
Sleep, 1000
WB.document.getElementById("login-email").value := "[email protected]" ; enter mail
Sleep, 100
WB.document.getElementById("login-password").value := "xxxxx"   ; enter pw
Sleep, 100
WB.document.getElementById("login-submit").click()  ;press login
While wb.readyState != 4 || WB.document.readyState != "complete" || wb.busy
Sleep, 1000
ToolTip , endlogin
WB.Navigate("https://www.ebay-kleinanzeigen.de/p-anzeige-aufgeben.html#?path=102/107&isParent=false")
While wb.readyState != 4 || WB.document.readyState != "complete" || wb.busy
Sleep, 1000
WB.document.querySelector("#postad-step1-frm > button.button").click()  ;click button not work 


ToolTip , end

Return
tm6464
Posts: 48
Joined: 17 Jul 2017, 22:56

Re: ComObjCreate need help click on a button

19 Oct 2018, 16:46

after some testing with our codd i found how it work

this was the problem
WB.document.querySelector("#postad-step1-sbmt > button.button").click() ; work
WB.document.querySelector("#postad-step1-frm > button.button").click() ; not work


thx a lot ,
hope u can help me again :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, Google [Bot], jomaweb, Rohwedder and 269 guests