Webpage fields and button click
I navigated to a webpage and able to add the Username and Password successfully. But I cant seem to invoke a button click.
Can someone please help me with the BUTTON CLICK
HTML Code:
<form id="auth" action="/nextgen/login" method="post">
<fieldset class="placeholder corner blur box-shadow condensed">
<label for="auth-login" class="no-select" data-translate-text="<% wsd.i18n._('Login') %>" unselectable="on"></label>
<input type="text" id="auth-login" name="loginUsername" data-sync="login" autocapitalize="off" spellcheck="false" maxlength="50">
</fieldset>
<fieldset class="placeholder corner blur box-shadow condensed">
<label for="auth-password" class="no-select" data-translate-text="<% wsd.i18n._('Password') %>" unselectable="on"></label>
<input type="password" id="auth-password" name="loginPassword" autocomplete="off" maxlength="50">
</fieldset>
<fieldset id="auth-submit" class="blur corner box-shadow">
<input class="corner" type="submit" data-translate-value="<% wsd.i18n._('Log In') %>">
</fieldset>
<fieldset class="help-links">
<a id="auth-help" href="#" data-translate-text="<% wsd.i18n._('Forgot password?') %>"></a>
</fieldset>
<fieldset class="help-links">
<a id="system-status" href="https://taxxxxxxxxx-status.hostedtax.xxxxxxxxxx.com/" target="_blank" data-translate-text="<% wsd.i18n._('System Status') %>"></a>
</fieldset>
<div class="trta1-captcha-container"></div>
</form>
Code:
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
WebBrowser1.Document.GetElementById("loginUsername").SetAttribute("value", "email")
WebBrowser1.Document.GetElementById("loginPassword").SetAttribute("value", "**")
WebBrowser1.Document.GetElementById("auth-submit").InvokeMember("post")
End Sub
Re: Webpage fields and button click
Looks like the page might have a captcha, pretty much to prevent people doing exactly what you are trying to do.
Re: Webpage fields and button click
I never have to add a captcha when logging in manually :D
Re: Webpage fields and button click
Is this a page you have created or one hosted by someone else?
Re: Webpage fields and button click
Yes. I am an accountant and my staff log in to a third party tax and accounts software. Which we pay for. I simply want a quick login process
Re: Webpage fields and button click
Quote:
Originally Posted by
raphipps
Yes. I am an accountant and my staff log in to a third party tax and accounts software. Which we pay for. I simply want a quick login process
Sounds like they don't want people automating their system.
Re: Webpage fields and button click
You pay for it, get in touch with the company.
What you are doing is web scraping, one way or the other, and it will give you no end of headaches. There is something in the makeup of web designers that they keep changing their web pages. It might look like a button today, be a <p> tag tomorrow, and something else the next day. Or maybe the act of clicking will change.
For this reason, automating web interactions is the LAST thing you should do. The FIRST thing is to look for an API. Those are created specifically to make it easier for a program to do certain things. If the company wants you to be using their site (and they presumably do, since they let you login to it), then they may well be interested in creating an API if they don't have one already. If you can work with an API, then do so, because it will make your life massively easier.
Other than that, you need to look at the terms of use (or whatever they call them on that site) for the site. If they say that they don't want you automating things, then there's that. Lots of sites do not, and for a variety of good and bad reasons. For that reason, lots of sites make it VERY hard to do things like 'click a button', with the goal being to make it impossible for anything other than a human to do so. This is an ongoing arms race, too, so if they say they don't want you automating anything, you can assume that even if you succeed, it will be only because you found a way around whatever restrictions they had in place, and those could change tomorrow.
Finally, this site does not support bypassing the terms of service of any other site. Since you are a paying customer of the site you are looking at, you likely have their assistance in whatever you want to do, and you should take advantage of that, but be sure that they allow it.
Re: Webpage fields and button click
Hi Shaggy that's a very helpful message...Ok I will re-think. I had asked for an API but that don't do any..Anyway thanks you for teaching me this