I’m not sure if I’m posting this to the right place but any advice I can get will be appreciate.
I want to Automate the downloading of files from 2 websites using Excel VBA.
The first website Log on page has name’s and id’s for the Log on elements.
The problem with the first website is that when I load the UserName and the password programmatically then manually click the Logon Button to test it, the UserName is rejected and the page asks to Re-enter the UserName. If I manually enter the UserName, I can Log on with the already loaded password once I click the Log on Button.
Can some tell me why I am getting rejected with programmatically loading the UserName. I noticed that when I manually type the UserName an 'X' appears at the end of the Box.
Here is a snippet of the code.
<input name="p$lt$ctl02$LogonShawForm$Login1$UserName" type="text" maxlength="100" id="p_lt_ctl02_LogonShawForm_Login1_UserName" class="simple form-control WatermarkText" autocomplete="off">
The second problem with the other web site is that the ‘SIGN IN’ button does not have any name or id that I can find.
I know it is in a Table but I do not know what name, class or tag name to reference.
This is the element that I’m trying to Click.
<input type="submit" value="SIGN IN" style="margin:5px 0px 5px 50px;background-color:#000000;color:#FFFFFF;
padding:3px 10px 3px 10px;border:2px solid black;font-weight:bold;" *******="update();return false;">
Below is some of the source code.
Thank you in advance for your help.
I want to Automate the downloading of files from 2 websites using Excel VBA.
The first website Log on page has name’s and id’s for the Log on elements.
The problem with the first website is that when I load the UserName and the password programmatically then manually click the Logon Button to test it, the UserName is rejected and the page asks to Re-enter the UserName. If I manually enter the UserName, I can Log on with the already loaded password once I click the Log on Button.
Can some tell me why I am getting rejected with programmatically loading the UserName. I noticed that when I manually type the UserName an 'X' appears at the end of the Box.
Here is a snippet of the code.
<input name="p$lt$ctl02$LogonShawForm$Login1$UserName" type="text" maxlength="100" id="p_lt_ctl02_LogonShawForm_Login1_UserName" class="simple form-control WatermarkText" autocomplete="off">
The second problem with the other web site is that the ‘SIGN IN’ button does not have any name or id that I can find.
I know it is in a Table but I do not know what name, class or tag name to reference.
This is the element that I’m trying to Click.
<input type="submit" value="SIGN IN" style="margin:5px 0px 5px 50px;background-color:#000000;color:#FFFFFF;
padding:3px 10px 3px 10px;border:2px solid black;font-weight:bold;" *******="update();return false;">
Below is some of the source code.
HTML:
******** language="JavaScript" type="text/javascript">
function update() {
if (validInput()) {
self.status="Login is in progress. Please wait...";
document.frmLogin.txtUserID.value = document.frmLogin.txtUserID.value.toUpperCase();
document.frmLogin.txtPassword.value = document.frmLogin.txtPassword.value.toUpperCase();
document.frmLogin.submit();
}
}
****** class="body" topmargin="5" ******="defaultStatus='Please Login to MohawkNet.';onPageLoadFocus();"
style="background-color: black;margin-bottom:0px;margin-top:10px">
<!--******** type="text/javascript" src="<!%= request.getContextPath() %>/javascript/ajax.js">*********>-->
<!--******** type="text/javascript" src="<!%= request.getContextPath() %>/javascript/floating-window.js">*********>-->
******** language="javascript" type="text/javascript">
<!-- break out of frames
if (window != top) top.location.href = location.href;
// -->
*********>
<div class="OuterPanel" align="center">
<div style="background-color: #000;height:10px; margin:0 0 0 -580px;"></div>
<div id="display" >
<input type="hidden" id="urlprefixhidden" value="/mnet">
<table width="960px" class="newfeatures" cellspacing="0" cellpadding="0" border="0">
<tr style="background-color: white;">
<td valign="top" style="background: #E8E0C9 url('/mnet/images/V1Fullhomescreen-Mohawknet.com.png');
height:454px;width:960px;background-repeat: no-repeat;">
<div style="margin:0 0 0 40px;">
<img src="/mnet/images/Logo_Login.png" alt="" />
</div>
<div style="width:320px;margin:18px 0px 0px 600px;">
<div id="TableTopRedlogin" name="TableTopRedlogin"> </div>
<form method="post" name="frmLogin" action="/mnet/servlet/MACSAppMgr">
<table style="background-color:#EE0F00;border-spacing:0px;"width="100%">
<tr>
<td colspan="3">
<div id="errorDiv" class="ErrorPanel" style="display: none;top:38%;background:#C7C0C1;">
<table width="100%">
<tr><td id="errormsg" style="background:#000000;color:#FFFFFF;">ATTENTION!</td></tr>
</table>
<table cellpadding="2" width="100%">
<tr>
<td align="center" valign="middle" width="25%"><img width="32" height="32" src="/mnet/images/important.png" alt=""></td>
<td><span id="errorSpan" class="errorMsg"></span></td>
</tr>
<tr>
<td align="center" valign="middle" colspan="2"><input type="BUTTON" value="OK" class="button" *******="document.getElementById('errorDiv').style.display='none'; focusError();"></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width="30px"> </td>
<td class="loginSectionText" style="padding-left:15px;">
<table>
<tr><td colspan="2" style="font-size:22px;color:#FFFFFF">GLAD YOU'RE BACK</td></tr>
<tr>
<td colspan="2">
<div style="background:#ABACAC;height:1px;"></div>
</td>
</tr>
<tr>
<td colspan="2" style="font-size:18px;color:#000000">
<input type="hidden" name="RequestName" value="Logon">
<input type="hidden" name="AttemptNumber" value="1">
LOG IN
</td>
</tr>
<tr>
<td style="padding:10px 0px;font-size:17px;color:#FFFFFF">User ID</td>
<td ><input type="text" name="txtUserID" size="15" maxlength="10"></td>
</tr>
<tr>
<td style="font-size:17px;color:#FFFFFF">Password</td>
<td ><input type="password" name="txtPassword" size="15" maxlength="10"></td>
</tr>
<tr style="text-align:center;">
<td colspan="2">
<input type="submit" value="SIGN IN"
style="margin:5px 0px 5px 50px;background-color:#000000;color:#FFFFFF;
padding:3px 10px 3px 10px;border:2px solid black;font-weight:bold;"*******="update();return false;">
Last edited by a moderator: