Create Service to search websites (with query)?

        

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.