Hi, I want to be able to read a https web page, enter a user name and
password in the fields returned and then read in the information that
is returned after this and then close the connection.
I have looked around but cannot spot how to do this. Can anyone give
me a pointer to a tutorial or something or point me in the right
direction?
Cheers
Okay have most of it working now in that I can read the page and
submit the name and password. I just use a WeRequest to send the
following
https://www.telstraclear.co.nz/usag...gin&password=mypassword&s=c&usagelogin=Submit
This should work but it does not. It returns an error saying that
element PASS is undefined in the form. Below is the source of the form
so it should work should it not as pass is there? It does fill in the
username field but won't go on the password.
Web Page Source below
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<HEAD>
<TITLE>Login to TelstraClear HighSpeed Internet Usage
Meter</TITLE>
<META NAME="Keywords" CONTENT="login, authentication">
<META NAME="Description" CONTENT="Form to login to
TelstraClear HighSpeed Internet usage meter.">
<script>
function checkForm(theForm){
var err = "";
var u = trimString(theForm.fquid.value);
var p = trimString(theForm.pass.value);
if (u.length == 0){
err = err + "- Username cannot be empty!";
}
if (p.length == 0){
err = err + "\n- Password cannot be empty!";
}
if (err.length != 0)
{
alert(err);
return false;
}
else
{
return true;
}
}
function trimString(theString) {
while (theString.charAt(0) == " ") {
theString =
theString.substring(1,theString.length);
}
while (theString.charAt(theString.length - 1) == " ")
{
theString =
theString.substring(0,theString.length - 1);
}
return theString;
}
</script>
</head>
<body bgcolor="ffffff"
onLoad="document.forms.loginForm.fquid.focus();">
<form name="loginForm" method="POST" action="/usagemeter/index.cfm"
onSubmit="return checkForm(this)">
<img src="images/dot-clear.gif" width=1 height=1 vspace=2> <br>
<table align="center" cellpadding=2 cellspacing=0 border=0
bgcolor="#999999">
<tr>
<td>
<table cellpadding=5 cellspacing=0 border=0 bgcolor="#f0f0f0">
<tr><td><font face="Arial, Helvetica" size=2
color="#666666"><b>Welcome to TelstraClear HighSpeed Internet Usage
Meter. Please Login.</b></font> </td></tr>
<tr>
<td align="center">
<font face="Arial, Helvetica" size=2
color="#666666"><b>User
Name</b><br>(
[email protected])</font><br>
<input type="text" name="fquid" maxlength="50"
size="30" value=""><br>
<img src="images/dot-clear.gif" width=1
height=1 vspace=2><br>
<font face="Arial, Helvetica" size=2
color="#666666"><b>Password</b></font><br>
<input type="password" name="pass"
maxlength="30" size="30" value=""><br>
<img src="images/dot-clear.gif" width=1
height=1 vspace=2><br>
<INPUT type="Hidden" name="s" value="c">
<input type="submit" name="usagelogin"
value="Submit">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>