这篇文章主要分享一个python网页请求模块urllib2模块的简单封装代码. 原文转自:http://www.jbxue.com/article/16585.html 对python网页请求模块urllib2进行简单的封装.例子: #!/usr/bin/python #coding: utf-8 import base64 import urllib import urllib2 import time class SendRequest: ''' This class use to set…
from httplib2 import Http def postDada(): http=Http() heads={"pragma":"no-cache"} data="" count=1 for i in range(count): res_h,res_b=http.request("http://urltracker.yunfan.com:8081/?opt=2", method="POST",h…