Reputation: 1
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
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