Create Service to search websites (with query)? I would like to create a Mac Service where I could search on some websites, from applications like Scrivener. For example (with "{query}" for where the word should be):

https://www.google.ca/search?q={query}&amp;safe=strict&amp;biw=1280&amp;bih=636&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ved=0ahUKEwjnysHu8NDPAhVEax4KHRwxB1AQ_AUICCgB

OR

https://www.amazon.ca/s/ref=nb_sb_noss?url=search-alias%3Daps&amp;field-keywords={query}

I already have the URLs, like the websites above, but I just need to know how to create the service in Automator.
Set the service to receive selected text, then add a Run Shell Script action with the following content, setting the shell to /bin/bash and passing the input as arguments.

for query in "$@"
do
    open "https://www.google.com/?q=$query"
done


Replace the URL with your desired URL, where $query is where you would like the selected text to be inserted in the string.

Also, that's all you need for a Google search — don't bother with the additional session parameters.