话不多说,参考Python, web forms and cookies:

import urllib
import urllib2
import cookielib

# enable cookie
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))

# login
login_data = urllib.urlencode({'iptUserName' : '', 'iptPassword' : ''})
resp ='http://******.com/user/user_login.asp?action=userlogin', login_data)

# adding friend recursively
for i in range(1, ):'http://******.com/dialog/dialog_collection_save.asp?iptType=0&intOID=%d' % i, {})


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">