I came across another question asking how to open Chrome using webbrowser
, and I wanted to do it for myself.
Python webbrowser.open() to open Chrome browser
I have a variable saved in the module called Chrome
Chrome = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe %s"
I did this so I could perform this code:
import webbrowser as wb
from webbrowser import Chrome
wb.get(Chrome).open('Google.com')
When I run this code, I get the following error:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
wb.get(Chrome).open('google.com')
File "C:\Users\MY USERNAME\AppData\Local\Programs\Python\Python37-
32\Lib\webbrowser.py", line 50, in get
if '%s' in browser:
TypeError: argument of type 'type' is not iterable
Why isn't this working? I'm running Python 3.7.