I'm trying to use the python webbrowser.open()
to open a webpage, the code run perfectly, did not has any error in the terminal, but no webpage has pop out.
import webbrowser
urlstr='https://www.twse.com.tw'
path=r"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe "
webbrowser.register('google chrome',None,webbrowser.BackgroundBrowser(path))
webbrowser.get('google chrome').open(urlstr,new=1,autoraise=True)
I tried Python 3.9.2 64-bit and Python 3.8.8 64-bit('base':conda) two environment but have same results.
But when I run the code with .ipynb file, it will pop out the webpage.
CODE :
What can I do to make the code run in vscode?