Use Apple Automator to automate opening webpages as follows, this can be programmed for (X) times or the time duration in the loop settings.
Use this to test, test and re-test.
Link:
https://discussions.apple.com/thread/250959248
automator close safari window script step
JNSoftware LLC points out that it is easiest ti add applescript step to close window: https://macscripter.net/viewtopic.php?id=8969
tell application "Safari"
do JavaScript "window.close();"
end tell