0

When I run:

import webbrowser
webbrowser.open("facebook.com")

It opens facebook on my default browser, but if try to specify a browser using:

import webbrowser
chrome = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe %s"
webbrowser.get(chrome).open("facebook.com")

It doesn't open anything (doesn't show any error messages either). Does anyone know why it doesn't open anything in the second example?

Lucan
  • 2,907
  • 2
  • 16
  • 30
Murilo
  • 1
  • 1

2 Answers2

1

Make sure to use the full path to the website

try: "https://www.facebook.com/" instead of "facebook.com"

that is: webbrowser.get(chrome).open("https://www.facebook.com/")

Refer this question where a similar problem has been discussed

Muhd Mairaj
  • 557
  • 4
  • 13
0

From documentation you can use an already registered chrome.

webbrowser.get('chrome')

other than this use the full URL as told by Muhd

Glauco
  • 1,385
  • 2
  • 10
  • 20