1

I hit another bump

webBrowser1.Document.GetElementById("submit_button").InvokeMember("click");

When it runs the button moves in the browser but it still do not work, I have to click the button twice that runs the code then it works

I tried using

webBrowser1.Document.GetElementById("submit_button").Focus();
webBrowser1.Document.GetElementById("submit_button").InvokeMember("click");

still not working

I think I need some kind of double click instead of only clicking once

1 Answer 1

1

As long as you are sure you have the proper ID for the element then the issue may just be that the "click" member is being invoked before the page has loaded.

Try this to be sure the document is loaded:

if (webBrowser1.ReadyState==WebBrowserReadyState.Complete)
    webBrowser1.Document.GetElementById("submit_button").InvokeMember("click");

If it is a double click that you need, possibly try invoking the click twice with a sleep in between of a couple seconds? It is not the cleanest method though..

Sign up to request clarification or add additional context in comments.

5 Comments

dident work, but what would fix it is some kind of waiting system before the click goes of, cause the information is applied to fast
Are you saying after the first click goes off for the double click or just in general?
what happens is that when it clicks it shakes the button then i click the generate button and then it works, so i have to press once then wait a couple of secounds then press again, so i would need like a timer
Do you have an approximation of how long you need in between clicks?
no i just click twice, do you have skype would be easier to talk over if u can

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.