我在用 requests post 正方教务系统时,发现返回的 text 中没有什么用户名错误或者密码错误或者验证码错误之类的(以 js 嵌在源代码中)。
网址是 http://jw.jluzh.com/
想看下各位大神是否也是这样
网址是 http://jw.jluzh.com/
想看下各位大神是否也是这样
|
1
缩减的代码,验证码获取那段删除了
import requests payload = { '__VIEWSTATE': "dDwyODE2NTM0OTg7Oz6axkqPO5u6m/sWzhMWZ6hy71QBYA==", 'txtUserName': "123456", 'TextBox2': "123456", 'txtSecretCode':"1234", 'RadioButtonList1': "学生", 'Button1:': '', 'lbLanguage': '', 'hidPdrs': '', 'hidsc': '' } headers = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Language': 'zh-CN,zh;q=0.8', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded', "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36" } r = requests.post("http://125.89.69.234/default2.aspx", headers = headers) print(r.text) |
|
estMay 30, 2016
2
试试 r.content
另外 requests 有 encoding 的坑。建议 r.encoding = None |
|
pathletboyMay 30, 2016
4
2 点
1 、你 payload 没发出去 2 、'Button1:': '', 这个多了个 : |
|
5
@pathletboy 第二点!!!
|
|
6
@pathletboy 谢谢!
|
|
cwlmxwbMay 30, 2016 via iPad
7
验证码你是采用获取图片人工输入还是用图像识别
|
|
atnootMay 30, 2016
9
post 之后会自动跳转? 可以 dir 一下 r 的方法 爬过几个网站 貌似 post 之后会去 get 某个页面
|