To be able to view the page source in Safari you need to enable the ‘Develop’ menu in the menu bar.
Do this by going to Preferences (
⌘+,) -> Advanced and then tick the box “Show Develop menu in the menu bar”.
Then just click Develop -> Show Page Source or as I prefer, hit
⌥+⌘+u to view the page source.