search for a data in my browser via script

Meeran Rizvi hmmeeranrizvi18 at gmail.com
Tue Feb 7 03:10:55 EST 2017


On Monday, February 6, 2017 at 8:13:17 PM UTC+5:30, Meeran Rizvi wrote:
> Hello guys,
> Here i am writing a script which will open my chrome browser and opens the URL www.google.com.
> But how to search for a data via script.
> for example i need to search for 'Rose' in google.com via script.
> how to do that?
> 
> <python>
> import webbrowser
> url="www.google.com"
> chrome_path = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe %s'
> webbrowser.get(chrome_path)
> webbrowser.open(url)
> </python>

This works as easy,when you search for a data in google.com via chrome
<python>
import webbrowser
search_word = 'Rose'
url = 'https://www.google.com/#q={}'.format(search_word)
chrome_path = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe %s'
webbrowser.get(chrome_path)
webbrowser.open(url)
</python>



More information about the Python-list mailing list