You can use AppleScript and Automator to automate tasks in Safari, such as opening webpages.
Using AppleScript you can create scripts to automate tasks. Scripts can open webpages, download a series of images for use by another application, and more.
Using Automator you can link several AppleScript actions into a workflow. You can use Automator workflows to browse the Internet and download items.
Both AppleScript and Automator are located in the Applications folder. To learn more about them, open them and then choose Help from their Help menus.