用python隔几分钟刷新一次网页,要怎么做

Python013

用python隔几分钟刷新一次网页,要怎么做,第1张

用urlopen和time组合一下呗,我一菜鸟只想到这个 #!/usr/bin/env python #coding=utf-8 import urllib2 html = urllib2.urlopen("http://****",timeout = 30).read() print html.decode("gbk").encode("utf-8")

browser = webdriver.Chrome() # 打开浏览器

browser.set_page_load_timeout(10) #10秒

while True:

    try:

        browser.get('你的网址')

        break

    except:

        pass