Python入门学习:网络刷博器爬虫

1.比较有趣,可以不断刷新指定的网址

2.源码:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import webbrowser as web  
import time  
import os  
import random  
count = random.randint(5,7)  
j=0  
while j<=count:  
    i=0  
    while i<=8 :  
        web.open_new_tab('https://www.baidu.com')  #网址自己填入  
        i=i+1  
        time.sleep(0.8)  
    else:  
        os.system('taskkill /F /IM chrome.exe')  
        print(j,'time webbrower closed') 
    j=j+1  

来源:http://www.centoscn.com/python/2014/0403/2716.html

原文地址:https://www.cnblogs.com/wuheng1991/p/8266899.html