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

Posted 侠岚之弋痕夕

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

以上是关于Python入门学习:网络刷博器爬虫的主要内容,如果未能解决你的问题,请参考以下文章