每隔一段时间访问百度

2015-09-24 0 489
每隔一段时间访问百度
#coding: utf-8
import sys
import urllib
import urllib2
from BeautifulSoup import BeautifulSoup
from time import sleep
while(True):
    try:
        res = urllib2.urlopen("http://www.baidu.com/")
        #baidu is encoded by gbk
        print res.read()
        sleep(3600) #per hour
    except(KeyboardInterrupt):
        print("\nbyebyebye.~")
        break
"""

遇见资源网 python 每隔一段时间访问百度 http://www.ox520.com/15812.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务