Presentation is loading. Please wait.

Presentation is loading. Please wait.

python中使用requests实现自动回帖

Similar presentations


Presentation on theme: "python中使用requests实现自动回帖"— Presentation transcript:

1 python中使用requests实现自动回帖
巫泽川 一览社群: qq群:

2 Requests模块介绍 Python标准库中的urllib2模块提供了大多数的HTTP功 能,但相对比Requests模块来说比较繁琐。 Requests 使用的是 urllib3,因此继承了它的所有特 性。Requests 支持 HTTP 连接保持和连接池,支持使 用 cookie 保持会话,支持文件上传,支持自动确定 响应内容的编码,支持国际化的 URL 和 POST 数据自 动编码。

3 Requests模块功能特性 Requests 完全满足如今网络的需求。 1、国际化域名和 URLs 2、Keep-Alive & 连接池
3、持久的 Cookie 会话 4、类浏览器式的 SSL 加密认证 5、基本/摘要式的身份认证 6、优雅的键/值 Cookies 7、自动解压 8、Unicode 编码的响应体 9、多段文件上传 10、连接超时 11、支持 .netrc 12、适用于 Python 2.6—3.4 13、线程安全

4 Requests模块HTTP基本功能范式
Requests简便的API意味着所有HTTP请求类型都是显而易见的,如下范例所示: >>> import requests >>> r = requests.put(" >>> r = requests.delete(" >>> r = requests.head(" >>> r = requests.options("

5 如何通过Requests模块实现回帖?

6 编程思路 1、通过抓包工具获取目标网站的登录功能和回复功能接口地址; 2、模拟真实用户打开浏览器; 3、post登录功能的接口,输入对应字段内容、已注册的账号和密 码; 4、post回复功能的接口,输入对应字段内容和回复内容;

7 使用wireshark抓包工具抓取目标接口地址

8 使用wireshark抓包工具抓取目标接口地址

9 在Linux 结果展示: ]# python autoreply.py Please enter your Please enter your password: bbe56e057f20f883e"} OK

10 实际页面展示效果:

11

12

13 谢谢大家!


Download ppt "python中使用requests实现自动回帖"

Similar presentations


Ads by Google