Python刷点击率,下载量代码

来源:互联网 发布:直销管理平台系统源码 编辑:程序博客网 时间:2024/05/01 23:18

【代码仅作学习之用,勿用于非法用途】

#!/usr/bin/env python# -*- coding:utf-8 -*-# @author: Wiker Yongimport urllib2, urllib;from threading import Thread;import re, os;import time'''获取HTTP返回'''def download(url):    try :        handler = urllib2.urlopen(url, '', 50000);        if handler.getcode()==200 :  #状态返回成功,注意不用进行读取数据            print ("200,close")             handler.close();    except:        print("Except")if __name__ == "__main__":    while True:        url = 'http://www.baidu.com';        print(url);        download(url);        time.sleep(3); #休眠时间秒


基于pythond 2.7


【转载请注明出处】

原创粉丝点击