iframe不在ipython-notebook中呈现

Jul*_*ang 8 python iframe ipython ipython-notebook

以下iframe不会在ipython-notebook中呈现

from IPython.display import HTML
HTML('<iframe src=http://stackoverflow.com width=700 height=350></iframe>')
Run Code Online (Sandbox Code Playgroud)

但是,这个将呈现(注意,.com与.org)

from IPython.display import HTML
HTML('<iframe src=http://stackoverflow.org width=700 height=350></iframe>')
Run Code Online (Sandbox Code Playgroud)

在第一个例子中,我有什么问题吗?如果这是一个错误,我在哪里提交错误报告?

zac*_*ach 26

IPython现在直接支持IFrame:

from IPython.display import IFrame
IFrame('http://stackoverflow.org', width=700, height=350)
Run Code Online (Sandbox Code Playgroud)

有关IPython嵌入的更多信息,请查看此IPython笔记本.


Mat*_*att 8

您有"拒绝显示文档,因为X-Frame-Options禁止显示".在JavaScript控制台中.有些网站明确拒绝在iframe中显示.