how to use python to control chrome browser code example

Example 1: how to open youtube from google chrome browser instead of internet explorerwhen coding in python

>>> import webbrowser as wb
>>> wb.register('chrome', None)
>>> wb.open('https://www.youtube.com')
True
>>> wb.open('https://www.google.com')
True
>>> wb.open('https://stackoverflow.com')
True

Example 2: how to open youtube from google chrome browser instead of internet explorerwhen coding in python

webbrowser.get('chrome').open('https://www.youtube.com')