没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
3页
采用python实现简单QQ单用户机器人的方法如下: 一、首先我们查看一下关于3GQQ的相关协议: 对此,打开一个支持WAP的浏览器,可以使用Firefox的wmlbrowser插件,打开FF后,访问地址 https://addons.mozilla.org/zh-CN/firefox/search/?q=wmlbrowser&cat=all&x=17&y=11 二、进入3GQQ的进行协议分析 3GQQ的地址是:http://pt.3g.qq.com/s?aid=nLogin3gqq 用安装了wmlbrowser插件的FF打开页面后,启用firebug,即可实现监视提交
资源推荐
资源详情
资源评论
采用采用python实现简单实现简单QQ单用户机器人的方法单用户机器人的方法
采用python实现简单QQ单用户机器人的方法如下:
一、首先我们查看一下关于3GQQ的相关协议:
对此,打开一个支持WAP的浏览器,可以使用Firefox的wmlbrowser插件,打开FF后,访问地址
https://addons.mozilla.org/zh-CN/firefox/search/?q=wmlbrowser&cat=all&x=17&y=11
二、进入3GQQ的进行协议分析
3GQQ的地址是:http://pt.3g.qq.com/s?aid=nLogin3gqq 用安装了wmlbrowser插件的FF打开页面后,启用firebug,即可实
现监视提交的数据。
三、源代码部分:
#coding:utf-8
#基于python2.6版本开发
import httplib,urllib,os,threading,re
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class PYQQ:
def __init__(self):
self.reqIndex = 0
#HTTP请求
def httpRequest(self,method,url,data={}):
try:
_urld = httplib.urlsplit(url)
conn = httplib.HTTPConnection(_urld.netloc,80,True,3)
conn.connect()
data = urllib.urlencode(data)
if method=='get':
conn.putrequest("GET", url, None)
conn.putheader("Content-Length",'0')
elif method=='post':
conn.putrequest("POST", url)
conn.putheader("Content-Length", str(len(data)))
conn.putheader("Content-Type", "application/x-www-form-urlencoded")
conn.putheader("Connection", "close")
conn.endheaders()
if len(data)>0:
conn.send(data)
f = conn.getresponse()
self.httpBody = f.read().encode('utf8')
f.close()
conn.close()
except:
self.httpBody=''
return self.httpBody
#通过首尾获取字符串的内容
def getCon(self,start,end):
findex = self.httpBody.find(start)
if findex == -1 : return None
tmp = self.httpBody.split(start)
eindex = tmp[1].find(end)
if eindex == -1:
return tmp[1][0:] else:
return tmp[1][0:eindex] #获取postfield的值
def getField(self,fd):
KeyStart = '')
#获取登陆验证码,并保存至当前目录的qqcode.gif
def getSafecode(self):
url = self.getCon('python_实现简单QQ单用户机器人
import urllib2
pager = urllib2.urlopen(url)
data=pager.read()
资源评论
weixin_38725902
- 粉丝: 4
- 资源: 930
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功