我想让python打开一个wesite,然后刷新它或重新打开它一定的次数 [英] i want python to open a wesite and then refresh it or reopen it a sertain amount of times

查看:161
本文介绍了我想让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")

这篇关于我想让python打开一个wesite,然后刷新它或重新打开它一定的次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆