import requests
from bs4 import BeautifulSoup
from apscheduler.schedulers.blocking import BlockingScheduler
url = ‘https://blog.csdn.net/Aceks/article/details/102713410’
kv = {‘user-agent’:‘Mozilla/5.0’}
times = 0
def visiteCSDN():
global url,kv,times
r = requests.get(url,headers = kv)
if r.status_code == 200 :
times = times + 1
print('访问量增加 ', times)
else:
print(‘访问失败’)
sched = BlockingScheduler()
sched.add_job(visiteCSDN,‘interval’,minutes=1)
sched.start()