webrecorder / pywb

Core Python Web Archiving Toolkit for replay and recording of web archives
https://pypi.python.org/pypi/pywb
GNU General Public License v3.0
1.34k stars 207 forks source link

Better support for Google Colab #848

Open CuloArdido opened 1 year ago

CuloArdido commented 1 year ago

When installing pywb in Google Colab following this procedure¹ and after starting the server², the pages I try to access within a collection appear blank because the scripts and CSS links point by default to http://colab.research.google.com/ instead of where they should be³.


  1. Before installing pywb you should run this command to avoid a dependency conflict: ``` !pip uninstall flask nbconvert -y ``` Then the procedure is the same as in the documentation but prepending a ! before each command.
  2. To start the server, the following must be executed: ```python from google.colab.output import eval_js # Show the link through which the user can access to the server print(eval_js("google.colab.kernel.proxyPort(8080)")) !wayback -p 8080 ``` The `-p` parameter would normally not be needed unless the user wants to use a port other than 8080.
  3. This is usually something like https://someid-port-colab.googleusercontent.com