python post 登陆yylc
来源:互联网 发布:求抢票软件 编辑:程序博客网 时间:2024/06/08 07:03
# !/usr/bin/env python# -*- coding: utf-8 -*-import urllib2import urllibimport cookielibimport jsonimport httplibimport reimport requestss=requests.session()print s.headersurl = "https://licai.yingyinglicai.com/user/login.htm"headers={ 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Host': 'licai.yingyinglicai.com', 'Referer': 'https://licai.yingyinglicai.com/index.htm',}r = s.get(url,headers=headers)r=r.text#print sprint type(r)r = r.encode('unicode-escape')print type(r)p = re.compile('.*token"\s+value="(.*?)".*')m = p.match(r)token = m.group(1)print tokenlogin_url='https://licai.yingyinglicai.com/user/loginByPwd.do'data = {'cell': '18072722237', 'password': 'xx', 'token': token}#data = urllib.urlencode(data)response = s.post(login_url, data=data,headers=headers)print responseprint response.status_codeprint response.contenturl='http://licai.yingyinglicai.com/index.htm'r= s.get(url,headers=headers)r = r.textprint rprint type(r)
阅读全文
0 0
- python post 登陆yylc
- Python post、get百度(登陆)
- Python post、get百度(登陆)
- Python 之 Post 登陆 Dz 论坛
- python--模拟POST登陆请求(待优化)
- python使用post登陆电子科大信息门户并保存登陆后页面
- Idhttp.post 登陆网站
- POST和GET登陆
- PHP模拟post登陆
- 模拟post登陆
- Python Post and Get 登陆web后台系统并抓取页面
- python post
- ASP.NET POST模拟登陆
- 后台登陆框post注入
- 易语言-post登陆百度
- PHP_CURL1之模拟POST登陆
- 登陆请求(post),利用ASIHTTPRequest;
- PHP_CURL之模拟POST登陆
- 为啥网站优化离不开SEO,并且方法不对会毁了网站
- Ubuntu安装mongoose问题
- Linux系统spi驱动程序分析---(二)
- 分页
- Kibana5.5.1安装
- python post 登陆yylc
- C语言模块化编程的例子
- Java基础 bit byte
- OSM编辑器ID安装
- c语言操作符表达式小结
- Android-计时
- PHP爬虫最全总结2-phpQuery,PHPcrawer,snoopy框架中文介绍
- 2017.10.19 LeetCode 二分 -> 69. Sqrt(x) -> 410. Split Array Largest Sum
- SEO顾问的工作是做什么?