Search code examples
pythonpython-webbrowser

python webbrowser


I've been using this module without problems by calling it as:

webbrowser.open("http link...")

now, however, I wanted to select a different browser, and according to the docs (http://docs.python.org/library/webbrowser.html#webbrowser.get) I wrote this

controller = webbrowser.get('firefox')
controller("http link...")

... and I get an error I'm unable to get rid of:

Exception in Tkinter callback
Traceback (most recent call last):
....
TypeError: 'Mozilla' object is not callable

any idea about it???


Solution

  • A Controller object is not callable. Do this:

    controller.open(url)