
1 xyxc0673 OP 缩减的代码,验证码获取那段删除了 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) |
2 est 2016-05-30 22:03:09 +08:00 试试 r.content 另外 requests 有 encoding 的坑。建议 r.encoding = None |
4 pathletboy 2016-05-30 22:38:53 +08:00 2 点 1 、你 payload 没发出去 2 、'Button1:': '', 这个多了个 : |
5 xyxc0673 OP @pathletboy 第二点!!! |
6 xyxc0673 OP @pathletboy 谢谢! |
7 cwlmxwb 2016-05-30 22:46:57 +08:00 via iPad 验证码你是采用获取图片人工输入还是用图像识别 |
9 atnoot 2016-05-30 23:28:18 +08:00 post 之后会自动跳转? 可以 dir 一下 r 的方法 爬过几个网站 貌似 post 之后会去 get 某个页面 |