hi
i want to make some auto login script.
anyone can help me make this auto login script?
i was tried but failed.
anyone can make this one to work?
thanks a lot

import sys,os
import mechanize, urllib

try:
        id = 'kimok222'
        pw = '1qaz2wsx'
        params = urllib.urlencode({'adult_yn':'N',
                                   'encoding_type':'utf-8',
                                   'fail_url':'',
                                   'game_id':'13',
                                   'id':id,
                                   'loginsite':'',
                                   'pwd':pw,
                                   'return_url':'hxxp://www.plaync.co.kr/?',
                                   'returnurl':'hxxp://www.plaync.co.kr/?',
                                   'save':'on',
                                   'site_id':'13'
                                   })
        rq = mechanize.Request("hxxps://login.plaync.co.kr/login/login", params)
        rs = mechanize.urlopen(rq)
        data = rs.read()
        print data
except:
exit(1)

This should do it, urllib should do all the dirty work, even with cookies, I've used this before to auto login, works perfectly

import urllib2,urllib
o = urllib2.build_opener( urllib2.HTTPCookieProcessor() )
urllib2.install_opener(o)
id='kimok222'
pw='1qaz2wsx'
p=urllib.urlencode({"id" : id, "pwd" : pw})
f=o.open("hxxps://login.plaync.co.kr/login/login", p)
data=f.read()
f.close()
#now to request something while logged in use this
#f=o.open()
#data=f.read()
#f.close()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.