How to link to Jupyter notebook from a local HTML page

Question:

I am learning Jupyter Notebooks at the moment. Is it possible to link a Jupyter Notebook to an HTML page.

For example, say I have an HTML page which is on my computer. Can I use this to link to a Jupyter Notebook, so when the link is clicked it loads the notebook in a viewer to be run?

Thanks,

BJR

Asked By: BillyJo_rambler

||

Answers:

I am not using Jupyter notebook this way (actually I use Jupyter Lab). However, if I understood correctly you want to click on link on HTML page in your local machine and run notebook.

If trying access Jupyter notebook via HTML link in your machine while notebook (server) is not running or you are using non-default browser while notebook is running you will reach page with following information which should be sufficient to plan you next steps:

Token authentication is enabled

If no password has been configured,
you need to open the notebook server with its login token in the URL,
or paste it above. This requirement will be lifted if you enable a
password.

The command:

jupyter notebook list

will show you the URLs of running servers with
their tokens, which you can copy and paste into your browser. For
example:

Currently running servers:
http://localhost:8888/?token=*****… :: /Users/you/notebooks

or you can paste just the token value into the password field on this
page.

See the documentation on how to enable a password in place of token
authentication, if you would like to avoid dealing with random tokens.

Cookies are required for authenticated access to notebooks.

Setup a Password You can also setup a password by entering your token
and a new password on the fields below:

Token

New password

Basically it means that: link to Jupyter notebook will work if you have started server with token autorhization and use default browser. You can set password which means that you can use whatever browser in your machine but must log in (you can save login credentials in your browser of course). In any case notebook (server) must have been started and running before using link.

Link will not run your notebook, it just opens notebook page.

Answered By: Aivar Paalberg
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.