I have written a python script that crawls a website and creates a json response file with the crawled data. Now, I want to use the json response but how do I make sure that the script executes periodically so that the json file is not static but keeps changing as the website which is being crawled changes it data?
Asked
Active
Viewed 63 times
2 Answers
-1
I believe you are looking for CRON.
The software utility Cron is a time-based job scheduler in Unix-like computer operating systems.

Loïc
- 11,804
- 1
- 31
- 49
-1
import schedule
import time
def job():
print("I'm working...")
schedule.every(10).minutes.do(job)
schedule.every().hour.do(job)
schedule.every().day.at("10:30").do(job)
while 1:
schedule.run_pending()
time.sleep(1)

Community
- 1
- 1

Ricky Wilson
- 3,187
- 4
- 24
- 29