Ich hab ein kleines Problem:
Ich versuche mittels Python auf Ogame.de ( ) einzuloggen um den aktuellen punktestand zu erfahren....
Und jetzt zu meinem Problem:
Ich bekomm immer diese Fehlermeldung:
Hier mein script:Traceback (most recent call last):
File "ogame.py", line 24, in ?
conn.request("POST", aktion, post)
File "/usr/lib/python2.4/httplib.py", line 804, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.4/httplib.py", line 827, in _send_request
self.endheaders()
File "/usr/lib/python2.4/httplib.py", line 798, in endheaders
self._send_output()
File "/usr/lib/python2.4/httplib.py", line 679, in _send_output
self.send(msg)
File "/usr/lib/python2.4/httplib.py", line 646, in send
self.connect()
File "/usr/lib/python2.4/httplib.py", line 614, in connect
socket.SOCK_STREAM):
socket.gaierror: (-2, 'Name or service not known')
Code: Alles auswählen
#!/usr/bin/env python
import httplib, urllib
username='benutzername'
password='passwort'
universum='55'
aktion="http://ogame465.de/game/reg/login2.php"
print 'Connecting...'
#Hole Timestamp
webseite=urllib.urlopen('http://ogame.de/portal/?lang=de&frameset=1')
webseite=webseite.read()
timestamp_pos=webseite.find('timestamp" value=')
timestamp_pos_end=timestamp_pos+29
timestamp=webseite[timestamp_pos:timestamp_pos_end]
timestamp=timestamp[18:28]
timestamp=timestamp.strip()
print 'Timestamp:',timestamp
post = urllib.urlencode({"timestamp": timestamp,"v":"2","Uni":"ogame465.de","login":username,"pass":password})
conn = httplib.HTTPConnection("http://ogame.de:80")
conn.request("POST", aktion, post)
response = conn.getresponse()
data = response.read()
conn.close()
print data
Woran könnte des liegen?
Vielen Danke im Voraus!