python刷投票的腳本實(shí)現(xiàn)代碼
原理就是用代理IP去訪問(wèn)投票地址。用到了多線程,速度飛快。
昨晚兩個(gè)小時(shí)就刷了1000多票了,主要是代理IP不好找。
2.7環(huán)境下運(yùn)行
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import urllib2
from threading import Thread
from time import time
class Vote(Thread):
def __init__(self, proxy):
Thread.__init__(self)
self.proxy = proxy
self.url = 'http://www.studentboss.com/zhuanti/2014/cncc/vote.php?id=19'
self.timeout = 10
def run(self):
proxy_handle = urllib2.ProxyHandler({"http": r'http://%s' % self.proxy})
opener = urllib2.build_opener(proxy_handle)
urllib2.install_opener(opener)
try:
req = urllib2.urlopen(self.url, timeout=self.timeout)
result = req.read().decode('gbk')
print result
pos = result.find(u'成功')
if pos > 1:
addnum()
else:
pass
except Exception,e:
print e.message,'error'
def addnum():
global n
n += 1
def shownum():
return n
n = 0
threads = []
proxylist = open('proxy.txt', 'r')
for proxy in proxylist:
t = Vote(proxy)
threads.append(t)
if __name__ == '__main__':
start_time = time()
for i in threads:
i.start()
for i in threads:
i.join()
print '%s votes have been voted successfully using %s seconds' % (shownum(), time()-start_time)
- python爬蟲(chóng)刷訪問(wèn)量 2019 7月
- 用python腳本24小時(shí)刷瀏覽器的訪問(wèn)量方法
- Python django框架應(yīng)用中實(shí)現(xiàn)獲取訪問(wèn)者ip地址示例
- python爬蟲(chóng)簡(jiǎn)單的添加代理進(jìn)行訪問(wèn)的實(shí)現(xiàn)代碼
- 對(duì)Python通過(guò)pypyodbc訪問(wèn)Access數(shù)據(jù)庫(kù)的方法詳解
- 微信小程序跳一跳游戲 python腳本跳一跳刷高分技巧
- 用Python寫(xiě)王者榮耀刷金幣腳本
- Python 批量刷博客園訪問(wèn)量腳本過(guò)程解析
相關(guān)文章
TFRecord格式存儲(chǔ)數(shù)據(jù)與隊(duì)列讀取實(shí)例
今天小編就為大家分享一篇TFRecord格式存儲(chǔ)數(shù)據(jù)與隊(duì)列讀取實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-01-01
Python Des加密解密如何實(shí)現(xiàn)軟件注冊(cè)碼機(jī)器碼
這篇文章主要介紹了Python Des加密解密如何實(shí)現(xiàn)軟件注冊(cè)碼機(jī)器碼,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-01-01
Python使用pygame模塊編寫(xiě)俄羅斯方塊游戲的代碼實(shí)例
這篇文章主要介紹了Python使用pygame模塊編寫(xiě)俄羅斯方塊游戲的代碼實(shí)例,最基本的方塊變換和行消除等功能都在代碼中一一體現(xiàn),需要的朋友可以參考下2015-12-12
python中class(object)的含義是什么以及用法
這篇文章主要介紹了python中class(object)的含義是什么以及用法說(shuō)明,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-02-02
numpy給array增加維度np.newaxis的實(shí)例
今天小編就為大家分享一篇numpy給array增加維度np.newaxis的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2018-11-11
ID3決策樹(shù)以及Python實(shí)現(xiàn)詳細(xì)過(guò)程
決策樹(shù)是我本人非常喜歡的機(jī)器學(xué)習(xí)模型,非常直觀容易理解,并且和數(shù)據(jù)結(jié)構(gòu)的結(jié)合很緊密,下面這篇文章主要給大家介紹了關(guān)于ID3決策樹(shù)以及Python實(shí)現(xiàn)的相關(guān)資料,需要的朋友可以參考下2024-01-01

