0

So I have a Python Selenium script that opens chrome, gets information, and then closes. My script is done, and I want to run it daily every 5 minutes. But how do schedule the script to do that? And how to make sure that the browser doesn't open every 5 minutes, but just does it on the background. (Or maybe on a server?) I am new to programming so could anyone describe it very detailed how to do it? Thank you so much!

2 Answers 2

1

Regarding running the script on a schedule, you are looking for a cron job.

how to make sure that the browser doesn't open every 5 minutes, but just does it on the background.

-- for this, I'm not sure what binding language, browser, or initilization setup you are using, but I think you want to run the browser in headless mode.

Sign up to request clarification or add additional context in comments.

1 Comment

Should my computer stay on the whole time then?
0

To make sure the browser opens in the background you can use Selenium's headless chrome option like this

from selenium import webdriver

options = webdriver.ChromeOptions()
options.headless = True
driver = webdriver.Chrome(CHROMEDRIVER_PATH, options=options)

To make the script run in interval you will have to use something like crontab for Linux or Windows Task Scheduler for windows

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.