2

I want to google search a specific phrase using python program that too in a specific browser like Mozilla/google chrome.

import webbrowser

url = "https://www.google.com.tr/search?q={}".format("Raspberry Pi")    
webbrowser.open(url)

I read this script in some post but it always go for the default browser in the system, can't i select or specify a different browser.

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
ragrawal3
  • 43
  • 1
  • 5

1 Answers1

2

Use webbrowser.get('browser') to specify a browser.

import webbrowser
url = "https://www.google.com.tr/search?q={}".format("Raspberry Pi") 
b = webbrowser.get('lynx')
b.open(url)