python通过urllib2提交http post请求,pythonurllib2,python通过urll
python通过urllib2提交http post请求,pythonurllib2,python通过urll
python通过urllib2提交http post请求
#!/usr/bin/python #coding=utf-8 import urllib import urllib2 def post(url, data): req = urllib2.Request(url) data = urllib.urlencode(data) #enable cookie opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) response = opener.open(req, data) return response.read() def main(): posturl = "http://www.xiami.com/member/login" data = {'email':'myemail', 'password':'mypass', 'autologin':'1', 'submit':'登 录', 'type':''} print post(posturl, data) if __name__ == '__main__': main()
相关内容
- python实现二叉树的创建和遍历,python实现二叉树,#codi
- 爬前100期双色球中奖号码,从中随机出下一期中奖号码
- Python获取Linux系统内存情况,pythonlinux,[Python]代码
- 分形图,,#!/usr/bin/e
- 选择打开选择文件 神龙 QQ29295842,神龙qq29295842,#!/usr/
- Python 调用 C++,python调用,#include <bo
- print &quot;hello python&quot;,,print "hello
- 将华氏温度转换成摄氏温度,或者相反,华氏摄氏,#-
- 用XML_RPC实现P2P,XML_RPC实现P2P,# -*- coding
- 有道词典导出的xml生词本文件提取出单词,xml生词,im
评论关闭