按键安卓POST登录论坛
准备工具1.fiddler抓包工具(我个人习惯用这个哈)
2.按键精灵安卓版
步骤1:打开抓包工具,访问论坛 浏览器访问bbs.anjian.com,到登录界面
步骤2:点击登陆,查看抓包工具,找到登录数据包步骤3:是不是你要的数据包,里面有你登录的时候填的账号密码POST
http://bbs.anjian.com/login.aspx?referer=showforum.aspx HTTP/1.1
Host: bbs.anjian.com
Connection: keep-alive
Content-Length: 90
Cache-Control: max-age=0
Origin:
http://bbs.anjian.comUpgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/6.2.4098.3 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer:
http://bbs.anjian.com/login.aspx?referer=showforum.aspxAccept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.8
Cookie: onlineusercount=724; allowchangewidth=; visitedforums=281; forumpageid=1; __qc_wId=832; pgv_pvid=1221055668; reurl=http://bbs.anjian.com/showforum-281-1.aspx; dntusertips=userinfotips=%e7%a7%af%e5%88%86%3a575%2c%e7%94%a8%e6%88%b7%e7%bb%84%3a%e9%ab%98%e4%b8%ad%e4%ba%8c%e5%b9%b4%e7%ba%a7%2c%e9%b2%9c%e8%8a%b1%3a+1%e6%9c%b5%2c%e6%9e%9c%e5%a3%b3%e5%b8%81%3a+1244%e4%b8%aa%2c%e7%b2%be%e7%81%b5%e5%b8%81%3a+76%e4%b8%aa; dntadmin=; dnt=visitedforums=281; dntVC=5BcU+WoPIwlrgSacyswsrwcbvvRzNv45zqzS/apFh2A=; __tins__341528=%7B%22sid%22%3A%201637030635023%2C%20%22vd%22%3A%207%2C%20%22expires%22%3A%201637032507409%7D; __51cke__=; __51laig__=7; Hm_lvt_5d96b144d9b7632ed0ce359527dcc65d=1637030636; Hm_lpvt_5d96b144d9b7632ed0ce359527dcc65d=1637030708
username=账号&password=密码&question=0&answer=&templateid=0&login=&expires=43200步骤4:【这是个post数据包,很明显能看出来吧】开始撸代码Dim url1 = "http://bbs.anjian.com/login.aspx?referer=showforum.aspx" //数据包中的链接
Dim path = "/tmp/cookies.txt" //cook存放路径
Dim 账号="" //账号
Dim 密码 = "" //密码
Dim data = "username="&账号&"&password="&密码&"&question=0&answer=&templateid=0&login=&expires=43200" //数据包拼接
Dim hader = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 " //协议头UA
Dim hader1 = "http://bbs.anjian.com/login.aspx?referer=showforum.aspx" //协议头来源地址,不是必要的,可不填,按键的都不填也行
Dim date1 = {"url":url1,"data":data,"code":"UTF-8", "setcookie":path, "cookie":"", "header":{"User-Agent":hader, "Referer":hader1}}
Dim login = Url.HttpPost(date1) // 内置10秒超时
TracePrint login
步骤5:登录成功判断- If UTF8.InStr(1, login, "鲜花") > 0 Then
- ShowMessage "登录成功"
- Else
- ShowMessage "登录失败"
- End If
- Delay 3000
复制代码 你也快来试试吧!