Automatic login to website (newbie)

P

phishboh

I'm trying to use PAMIE to login to a website:

import cPAMIE

# python.org - just a test, works fine
ie = cPAMIE.PAMIE()
website = "http://www.python.org"
ie.navigate(website)
ie.textBoxSet('q', 'pamie')
ie.buttonClick('submit')

# expekt.com - this is what I want to do, but it fails
ie = cPAMIE.PAMIE()
website = "http://www.expekt.com/eng"
ie.navigate(website)
ie.textBoxSet('user', 'MyLogin')
ie.textBoxSet('pass', 'MyPassword')
ie.buttonClick('actn')

The first part of the script works fine, i.e., I can successfully open
IE, navigate to python.org, and do a search for "pamie".
However, when trying to login to the Expekt website, nothing is
entered in the text boxes, since they cannot be found. If I manually
navigate to the Expekt website, right click next to the login boxes,
and view source it looks like this:

<form name="loginForm" method="post" action="https://www.expekt.com:
443/userServlet?action=login" autocomplete="off" target="_top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="loginText">user:</td>
<td width="110"><input type="text" name="user" class="login"></
td>
</tr>
<tr>
<td class="loginText">password:</td>
<td width="110"><input type="password" name="pass"
class="login"></td>
</tr>
<tr>
<td colspan="2"><a class="loginForgot" href="javascript:wnd('/
user/password_retriever.jsp');">Forgot my password</a> </td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit"
class="loginButton" id="log in" value="login"></td>
</tr>
</table>
<input type="hidden" name="actn" value="login"></input>
<input type="hidden" name="lc" value="eng"/></input>
</form>

To my (limited) understanding, it looks like I have the correct names
of the text boxes ("user" and "pass")?
Problem with frames?
Any ideas how to make it work?

Is there a better way of automatically logging in to websites (and
then navigating within the site)?

Many thanks in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top