代码拉取完成,页面将自动刷新
"""
Created on Thu Apr 27 16:28:36 2017
@author: barnabysandeford
"""
# Currently works for Safari, but just change to whichever
# browser you're using.
import time
#Changed the method of opening the browser.
#Selenium allows for the page to be refreshed.
from selenium import webdriver
#adding ability to change number of repeats
count = int(input("Number of times to be repeated: "))
#Same as before
url = input("Enter the URL : ")
print( "Length of video:")
minutes = int(input("Minutes "))
seconds = int(input("Seconds "))
#Calculating the refreshrate from the user input
refreshrate = minutes * 60 + seconds
#Selecting Safari as the browser
driver = webdriver.Safari()
if url.startswith("https://"):
driver.get(url)
else:
driver.get("https://"+url)
for i in range(count):
#Sets the page to refresh at the refreshrate.
time.sleep(refreshrate)
driver.refresh()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。