Swastik Kakran
Swastik Kakran

Reputation: 1

error opening websites using webbrowser module in python

while using webbrowser module to open websites, got this error

code:

import webbrowser

webbrowser.open('youtube.com')

error:

gio: file:///home/swastik/Python/Programs/F.R.I.D.A.Y./youtube.com: Error when getting information for file “/home/swastik/Python/Programs/F.R.I.D.A.Y./youtube.com”: No such file or directory

Upvotes: 0

Views: 705

Answers (1)

MUSIC HOLIC
MUSIC HOLIC

Reputation: 88

You should write full url like

import webbrowser

webbrowser.open("https://www.youtube.com")

then it would work fine if you don't want to open this with your default browser you can use

webbrowser.get('chrome %s').open_new_tab('https://www.youtube.com')

Upvotes: 1

Related Questions