On this page
webbrowser.open
Prev: webbrowser.get | Up: webbrowser | Next: webbrowser.open_new
Rel: webbrowser.Error, webbrowser.get, webbrowser.open_new, webbrowser.open_new_tab
Ref: docs.python.org — webbrowser.open
Tags: #public #python3 #stdlib #webbrowser
Import
import webbrowser
from webbrowser import open
Signature & Overview
webbrowser.open(url, new=0, autoraise=True)
Display url using the default browser.
Usage
import webbrowser
# Opens a URL in the user's default browser (returns True if launched):
# webbrowser.open("https://docs.python.org/3/")
assert callable(webbrowser.open)
Gotchas
- Validate URLs before calling: Never pass untrusted user strings directly (could launch local schemes).
REPL Inspect
from webbrowser import open
help(open)
Linked from
Related notes
- tuts/python3/stdlib_module/webbrowser/Error Linked here; links to this page; shared tags: #stdlib, #webbrowser
- tuts/python3/stdlib_module/webbrowser/get Linked here; links to this page; shared tags: #stdlib, #webbrowser
- tuts/python3/stdlib_module/webbrowser/open_new Linked here; links to this page; shared tags: #stdlib, #webbrowser
- tuts/python3/stdlib_module/webbrowser/open_new_tab Linked here; links to this page; shared tags: #stdlib, #webbrowser
- tuts/python3/stdlib_module/webbrowser Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/webbrowser/register links to this page; shared tags: #stdlib, #webbrowser
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib