I want to make my notebook such that a website open within notebook and anything I do/click in website, it works like it open in new tab but remains within ipython notebook cell only. I know about selenium package which open the website in new tab or there are other ways to0 but every time, I need to leave notebook and go to either new window/tab. So how can I make my ipython notebook such that it open website within cell and whatever I do, it remains within notebook. Thanks
You can try this:
%%html
<iframe src="https://playground.tensorflow.org" width="1200" height="1000"></iframe>
For sites that can be embedded in IFrame, you can try
from IPython.display import IFrame
IFrame("https://www.openasapp.com/embedding-an-iframe-step-by-step/", 900,500)
This will work if IFrame() is the last thing called in the cell becuase Jupyter Notebooks automatically call the display function on the last active line in the cell. If you want to have this at the beginning of the cell, you will need to call display manually like this
from IPython.display import IFrame
display(IFrame("https://www.openasapp.com/embedding-an-iframe-step-by-step/", 900,500))
print("This code is now the last line, so we need to call display(Iframe()) explicitly")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With