#!/usr/bin/env python
#coding=utf-8
import webbrowser as web
import time
import os
import random
count = random.randint(10, 20) #产生随机数
j = 0;
while j < count:
i = 0
while i < 3: #循环打开次数
web.open_new_tab('http://blog.csdn.net/yuan_lo/article/details/xxx') #要刷的博客
i = i + 1
time.sleep(0.8) #让进程停留0.8,
os.system('killall firefox') #关闭浏览器
j = j + 1
16篇原创博文的地址放在一个txt文件,设置循环访问,每次访问间隔3s,每轮访问间隔30s,如此一来,访问所有博文一遍大概需要一分半钟,一小时可以刷到600的访问量.
https://blog.csdn.net/qq_33704787/article/details/xxx
https://blog.csdn.net/qq_33704787/article/details/xxx
https://blog.csdn.net/qq_33704787/article/details/xxx
https://blog.csdn.net/qq_33704787/article/details/xxx
https://blog.csdn.net/qq_33704787/article/details/xxx
https://blog.csdn.net/qq_33704787/article/details/xxx
import requests
import time
from bs4 import BeautifulSoup
i=1
while True:
file=open('blogs.txt', 'r',encoding='utf-8',errors='ignore')
while True:
url=file.readline().rstrip()
header={"user-agent":"Mozilla/5.0"}
try:
data=requests.get(url=url,headers=header)
except ValueError:
break
else:
print(data.status_code,end='')
if(data.status_code == 200):
print(f"访问{url}成功")
else:
print(f"访问{url}失败")
time.sleep(3)
file.close()
print(f"第{i}轮")
time.sleep(30)
i+=1