Code: Alles auswählen
<fieldset>
<label for="Login_email">E-Mail</label><br />
<input onfocus="this.hasfocus='yes';" class="fieldText" type="text" name="email" id="Login_email" value="" /><br />
<label for="Login_password">Passwort</label><br />
<input onfocus="this.hasfocus='yes';" class="fieldText" type="password" name="password" id="Login_password" value="" /><br />
<input onfocus="this.hasfocus='yes';" class="fieldBtnSubmit" type="submit" name="login" value="Einloggen" />
<input type="hidden" name="jsEnabled" id="jsEnabled" value="false" />
<script type="text/javascript">
document.getElementById('jsEnabled').value = 'true';
</script>
<input type="hidden" name="formkey" value="39676914ee20e8ab0e787abeb5a67c2edb68c4c8458e784e5a74c81ef53c52d1aee84b85fa32bac46fd959949e4657991fb0780877524189c29f7e3d5499f6ac" />
<input type="hidden" name="iv" value="909e9b827a4e3d4bd49c03139d32d02c" />
<input type="hidden" name="checkcode" value="da9bcd35c32d9062e79dff7457cb43cb" />
</fieldset>
Code: Alles auswählen
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
import sys
import mechanize
import urllib
import urllib2
sys.stderr = file("zerrors.log", "w")
def login():
# Login
loginurl = "webseite"
logindata = urllib.urlencode(
{
"email": "email",
"password": "passwort",
"login": "Einloggen",
"jsEnabled": "false",
"formkey": "39676914ee20e8ab0e787abeb5a67c2edb68c4c8458e784e5a74c81ef53c52d1aee84b85fa32bac46fd959949e4657991fb0780877524189c29f7e3d5499f6ac",
"checkcode": "da9bcd35c32d9062e79dff7457cb43cb",
}
)
response = mechanize.urlopen(loginurl, logindata)
response.read()
login()
schon mal vielen Dank
Teabag