My script serves as a web browser that is browsing the net according to the website provided on links.txt and the time interval stated. It should be available 24/7. Does anybody see any possible way to improve the code according to the goal of the script? The following is the code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import pyautogui
import time
import os.path as path
import sys
def runlinks(f):
for line in f:
key, val = line.split(";")
driver.get(key)
pyautogui.moveTo(5000, None)
time.sleep(int(val))
pyautogui.press('f15')
return()
driver = webdriver.Firefox()
pyautogui.press('f11')
count = 0
infile = "Z:\Full-Route\links.txt" #This is your links's file Path
while count < 1:
try:
with open(infile, "r") as f:
runlinks(f)
except:
pass