Python Automation Tutorial to Open Chrome Browser Automatically Using WebBrowser Library

 

Welcome folks today in this tutorial we will be seeing how to open chrome browser automatically using the webbrowser module. This will be kind of a Python Automation Tutorial. All the source code is given below. A step by step youtube video is shown below.

 

 

 

 

 

script.py

 

import webbrowser


url1 = 'youtube.com'
url2 = "google.com"
url3 = "github.com"
chrome_path = r'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'
webbrowser.register('chrome', None, webbrowser.BackgroundBrowser(chrome_path))
webbrowser.get('chrome').open_new_tab(url1)
webbrowser.get('chrome').open_new_tab(url2)
webbrowser.get('chrome').open_new_tab(url3)

 

 

Now if you run the script at the command prompt when it will open chrome browser automatically and it will open three tabs and it will open google, youtube and github website automatically.

See also  Python 3 Google Contacts or People API Example to Create New Contacts Full Project For Beginners

 

Leave a Reply