Get the name of the web page in Safari
osascript -e 'tell app "safari" to get the name of the current tab of window 1'
Get the title of the web page in Google Chrome
osascript -e 'tell app "google chrome" to get the title of the active tab of window 1'