python操作cookie ,curl请求
来源:互联网 发布:人工智能猜想 编辑:程序博客网 时间:2024/05/22 03:50
Python实现登陆后产生的cookie请求
import cookielibimport urllib2import urllibc = cookielib.LWPCookieJar()opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(c))login_path = "urllogin"data = {"username":"******", "password":"******","isEncypted":"false"}post_info = urllib.urlencode(data)request = urllib2.Request(login_path, post_info)html = opener.open(request)for item in c: print item.name print item.valuehanderl = urllib2.HTTPCookieProcessor(c)opener = urllib2.build_opener(handerl)res = opener.open('url')print res.read()
curl利用cookie请求
#http请求可以查到数据curl -s --header "Content-Type:application/x-www-form-urlencoded; charset=UTF-8" -O -c cookie -d "username=******&password=******&isEncypted=false" urlcurl -s --header "Content-Type:application/json; Accept-Encoding:'zip, deflate'; Accept-Language:'zh-CN,zh;q=0.8';X-Requested-With:XMLHttpRequest" -b cookie -X GET "url"
curl利用cookie实现restful 请求
curl -s --header "Content-Type:application/x-www-form-urlencoded; charset=UTF-8" -O -c cookie -d "username=******&password=******&isEncypted=false" urlcurl -b cookie -X GET url
阅读全文
0 0
- python操作cookie ,curl请求
- php curl携带 cookie 请求
- curl HTTP请求基本操作
- cocos2d-x 引擎: 通过curl操作cookie
- python请求时cookie处理
- python的cookie操作
- curl携带jsession方式请求,获取cookie等
- python perl curl 模拟get请求
- curl perl python 模拟post请求
- CURL COOKIE
- curl perl python get请求带请求头
- curl请求
- curl请求
- curl请求
- python 的cookie处理操作
- python http请求及cookie的模拟
- python http请求及cookie的模拟
- python http请求以及Cookie的模拟
- String函数功能总结
- 初识Appium
- Unity优化大全(七)之 GPU-Ligh和其他
- 数值的扩展
- PHPCMS V9表单向导检测必填和返回地址的两个细节修改
- python操作cookie ,curl请求
- m1卡工作原理和相关总结
- django wechatpy建立微信简单自动回复
- Unity优化大全(八)之 Memory
- 【SpringCloud】SpringCloud简介
- juicerjs引用模板的使用方式
- ubuntu 安装配置 MongoDB3.4
- 中国大学慕课C语言第五讲笔记
- 封装通用的底部导航栏