0x0前言:
答應了一個朋友幫他刷貼,自己用python寫了一個腳本刷。
雖然行為不好。。但是缺錢用。。。
0x01准備:
splinter模塊:
chrome瀏覽器驅動
0x02開始:
1.進入百度貼吧
2.自動登錄
3.自動寫內容
4.自動發帖
5.循環發送
0x03代碼:
from splinter.browser import Browser
import time
import win32api
import win32con
sope=Browser(driver_name="chrome")
sope.visit("http://tieba.baidu.com/f?ie=utf-8&kw=hello")
sope.click_link_by_text('登錄')
time.sleep(2)
sope.find_by_id('TANGRAM__PSP_11__footerULoginBtn').click()
sope.fill('userName','xxxxxxxx')
sope.fill('password','xxxxxxxx')
sope.find_by_id('TANGRAM__PSP_11__submit').click()
time.sleep(15)
sope.fill('title','刷hello粉絲')
sope.find_by_id('ueditor_replace').fill('hello子昂網絡工作室\n'
'hello粉絲價格介紹:\n'
'10元=2000粉絲\n'
'20元=4000粉絲\n'
'30元=6000粉絲\n'
'金幣光\n'
'1w4金幣=10元\n'
'2w6金幣=18元\n'
'金幣禮物8元一套整\n'
'鑽石禮物65/45/20套餐\n'
'要的找我:微信號:b1292681469\n')
win32api.keybd_event(17,0,0,0)
win32api.keybd_event(108,0,0,0)
win32api.keybd_event(17,0,win32con.KEYEVENTF_KEYUP,0)
win32api.keybd_event(108,0,win32con.KEYEVENTF_KEYUP,0)
運行如下:
0x04遭遇檢測:
我特么真的服,這個坑B貼吧。后面我各種嘗試還是過不了這個該死的檢測。
只能通過另一個貼吧發布。
0x05另尋目的:
http://bbs.haidiao.com
看了一下個
看了一下垃圾站一個,應該沒有什么檢測
直接開始構造代碼然后開刷。
from splinter.browser import Browser import time import win32api import win32con sope=Browser(driver_name="chrome") sope.visit('http://haidiao.com/member.php?mod=logging&action=login') sope.fill('username','xxxx') sope.fill('password','xxxx') sope.find_by_name('loginsubmit').click() time.sleep(6) sope.find_link_by_text('論壇').click() time.sleep(8) sope.find_link_by_text('攝影專區').click() time.sleep(5) sope.find_by_id('newspecial').click() time.sleep(5) sope.fill('subject','刷hello粉絲') sope.find_by_id('e_switchercheck').click() sope.fill('message','hello子昂網絡工作室\n' 'hello粉絲價格介紹:\n' '10元=2000粉絲\n' '20元=4000粉絲\n' '30元=6000粉絲\n' '金幣光\n' '1w4金幣=10元\n' '2w6金幣=18元\n' '金幣禮物8元一套整\n' '鑽石禮物65/45/20套餐\n' '要的找我:微信號:b1292681469\n') divs=sope.find_by_tag('div') divs.first.find_by_name('單擊進行人機驗證') time.sleep(3) sope.find_by_name('topicsubmit').click()