0

I'm running this code on Google Colab to open an website and it's not working:

import webbrowser as wb
wb.get('C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s').open_new_tab('https://www.santanderoper.com.br/d5/pages/login/pt-BR/login-ativo.xhtml')

Does someone know why? Please.

furas
  • 134,197
  • 12
  • 106
  • 148
  • Google Colab runs code on server so it also opens browser on server, not on your local computer. And it tries to display browser on monitor directly connected to server, not on monitor connected to your local computer. Other problem: browser runs on server so it can't have access to programs on local disk `C:/...`. As for me you would need rather to use some JavaScript to open it in current browser because `JavaScrip` has access to your current browser - but it can't run other browser (using `C:/...`) beacuse it is blocked in browsers because it could be used by hackers to get your passwords. – furas Jan 20 '22 at 20:30
  • [google colaboratory - Is there any way to open a new tab using a webbrowser module of python in colab?](https://stackoverflow.com/questions/61334777/is-there-any-way-to-open-a-new-tab-using-a-webbrowser-module-of-python-in-colab) – furas Jan 20 '22 at 20:32

0 Answers0