我想让python打开一个wesite,然后刷新它或重新打开它一定的次数

问题描述:

这是我到目前为止所拥有的:

here is what i have so far:

loop = 1
print ("Copy your Youtube link")
Website = input (">>>")
print ("How manmy views would you like to get?")
Views = input (">>>")
print (Website)
print (Views)

import time
import webbrowser
Websites = webbrowser.open(Website) THIS IS WHERE I WANT THE WEBSITE TO REFRESH OR OPEN MORE. THE (VIEWS) amount
print ("There you go")

我认为这将使您实现目标.该程序还将允许用户控制一次打开的页面数量以及关闭页面的延迟.这允许计算机规格上的差异.

I think this will let you achieve your objectives. The program will also allow the user to control the amount of pages opening at one time as well as the the delay in closing them. This allows for differences in computer specs.

import os
import time
import webbrowser

cycles=int(input("Please input the number of cycles you want to run"))
num=int(input("Please input the number of pages you want to open in each cycle"))
delay=int(input("Please input the time delay for restarting the cycle"))
website = input("Please input your web address")

hits=cycles*num
print("You will access " +website+ " " , hits, " times")

for i in range(cycles):
    for i in range(num):
        webbrowser.open(website)
    time.sleep(delay)
    os.system("tskill /A iexplore")
    os.system("tskill /A Chrome")