I tried to take the input from the user, copy it, and then open google and paste the input.
this is my code:
import webbrowser
import pyperclip
question = input("search for: ")
pyperclip.copy(question)
url = 'http://www.google.com/'
chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
webbrowser.get(chrome_path).open(url)
pyperclip.paste()
import webbrowser
question = input("search for: ")
question = question.replace(' ', '+') # replace <space> with +
url = 'https://www.google.com/search?q=' + question # google search url
chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
webbrowser.get(chrome_path).open(url)
You don't need to paste the url.
When you search a url something like "hello world" in the browser
the url is
The spaces are replaced with + sign.