获取iFrame的源代码 [英] Getting source code of iFrame

查看:70
本文介绍了获取iFrame的源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能告诉我如何在iframe中获取页面的源代码吗? (弹出窗口

窗口是可点击的图像)。

当我右键单击此弹出边框查看源代码时,我看到

跟随


< html>

< head>

< title>新优惠!< / title>

< / head>

< body style =" margin-left:0%;保证金权利:0%; margin-top:0%;

margin-bottom:0%">

< iframe scrolling =" no" MARGINWIDTH =" 0" MARGINHEIGHT =" 0" frameborder =" 0"

height =" 100%"宽度= QUOT; 100%QUOT;

SRC =" HTTP://ad.yieldmanager.com/iframe3 2gIAAFWkAAATzgIA11UBAAAANAAAAA0AAgABEgACAA HSJgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ABZAAAAAAAAAFkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA FCsI9Z8u8wG6XUHnMRiV9-的Tu6-laFxCGFkmTVwAAAAA = ,, HTTP:// WWW?。 findarticles.com/p/articles/tn_comp/mi_zdpcm/">

< / iframe>

< / body>

< / html>


当我在浏览器中复制iframe网址并尝试获取此页面时,它只是

显示空白页面:


< html>

< body>

<! - 交货记录解码失败,原因= 4(查询字符串

已过期) - >

< / body>

< / html>


As我知道,这是一个动态创建的iframe,并且很难获得它的来源因为iframe源来自不同的

域作为原始页面。是否有一些基于脚本的解决方案(PHP,

javascript)来检索和显示这样的目标iframe源?


谢谢。

Can anybody tell me how to get source code of page in iframe? (popup
window is clickable image).
When I right click on this popup border to view source, i see just as
follows

<html>
<head>
<title>New offer!</title>
</head>
<body style="margin-left: 0%; margin-right: 0%; margin-top: 0%;
margin-bottom: 0%">
<iframe scrolling="no" marginwidth="0" marginheight="0" frameborder="0"
height="100%" width="100%"
src="http://ad.yieldmanager.com/iframe3?2gIAAFWkAAATzgIA11UBAAAANAAAAA0AAgABEgACAA HSJgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ABZAAAAAAAAAFkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA FCsI9Z8u8wG6XUHnMRiV9-Tu6-laFxCGFkmTVwAAAAA=,,http://www.findarticles.com/p/articles/tn_comp/mi_zdpcm/">
</iframe>
</body>
</html>

When i copy iframe url in browser and try to get this page, it just
show empty page:

<html>
<body>
<!-- Delivery record decoding failed with reason = 4 (Query string
expired) -->
</body>
</html>

As far I know, that is a dynamically created iframe, and its difficult
to get it source because the Iframe source comes from a different
domain as the original page. Is there some script-based solution (PHP,
javascript) to retrieve and display target iframe source like this?

Thanks.

推荐答案



mistral写道:

mistral wrote:

任何人都可以告诉我如何在iframe中获取页面的源代码? (弹出窗口

窗口是可点击的图像)。

当我右键单击此弹出边框查看源代码时,我看到

跟随


< html>

< head>

< title>新优惠!< / title>

< / head>

< body style =" margin-left:0%;保证金权利:0%; margin-top:0%;

margin-bottom:0%">

< iframe scrolling =" no" MARGINWIDTH =" 0" MARGINHEIGHT =" 0" frameborder =" 0"

height =" 100%"宽度= QUOT; 100%QUOT;

SRC =" HTTP://ad.yieldmanager.com/iframe3 2gIAAFWkAAATzgIA11UBAAAANAAAAA0AAgABEgACAA HSJgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ABZAAAAAAAAAFkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA FCsI9Z8u8wG6XUHnMRiV9-的Tu6-laFxCGFkmTVwAAAAA = ,, HTTP:// WWW?。 findarticles.com/p/articles/tn_comp/mi_zdpcm/">

< / iframe>

< / body>

< / html>


当我在浏览器中复制iframe网址并尝试获取此页面时,它只是

显示空白页面:


< html>

< body>

<! - 交货记录解码失败,原因= 4(查询字符串

已过期) - >

< / body>

< / html>


As我知道,这是一个动态创建的iframe,并且很难获得它的来源,因为Iframe源来自不同的原始页面的
域。是否有一些基于脚本的解决方案(PHP,

javascript)来检索和显示这样的目标iframe源?


谢谢。
Can anybody tell me how to get source code of page in iframe? (popup
window is clickable image).
When I right click on this popup border to view source, i see just as
follows

<html>
<head>
<title>New offer!</title>
</head>
<body style="margin-left: 0%; margin-right: 0%; margin-top: 0%;
margin-bottom: 0%">
<iframe scrolling="no" marginwidth="0" marginheight="0" frameborder="0"
height="100%" width="100%"
src="http://ad.yieldmanager.com/iframe3?2gIAAFWkAAATzgIA11UBAAAANAAAAA0AAgABEgACAA HSJgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ABZAAAAAAAAAFkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA FCsI9Z8u8wG6XUHnMRiV9-Tu6-laFxCGFkmTVwAAAAA=,,http://www.findarticles.com/p/articles/tn_comp/mi_zdpcm/">
</iframe>
</body>
</html>

When i copy iframe url in browser and try to get this page, it just
show empty page:

<html>
<body>
<!-- Delivery record decoding failed with reason = 4 (Query string
expired) -->
</body>
</html>

As far I know, that is a dynamically created iframe, and its difficult
to get it source because the Iframe source comes from a different
domain as the original page. Is there some script-based solution (PHP,
javascript) to retrieve and display target iframe source like this?

Thanks.



有很多工具可以实现这一点。我认为firefox

内置了对它的支持。如果没有,那么它将是我使用的Web开发人员

扩展(由Chris Pederick提供),这是(恕我直言),一个必不可少的
工具包,我无法想象没有它我是如何生活的。您可以使用这个来查看生成的源,而不是单击查看源时看到的静态源

,这是一份硬拷贝

的原版,永远不会改变。


另外,firefox有一个你可以使用的JavaScript控制台,虽然

我使用一个名为Firebug的方便扩展,它允许你做各种各样的事情,比如检查DOM。您可以尝试从Firebug控制台获取这样的内容:


var newWindow = open("","");

var theFrame = frames [0] .cloneNode(true);

newWindow.appendChild(theFrame);


这应该打开一个新的窗口,取出文档中的第一帧,

克隆它,并将其放入新窗口文档中。我认为可能

只能使用iframe,所以如果它们是真正的帧,你可能需要将帧移动到新文档的框架集中(我

将留给你弄明白。


你也可以将命令组合成一行,并预先添加

''javascript :'',然后将其粘贴到地址栏中,例如

这个:

javascript :var newWindow = open("",""); var

theFrame = frames [0] .cloneNode(true); newWindow.appendChild(theFrame);


这将调用JavaScript引擎来解析你发送它的代码。或者,您可以一次执行一行。


但是,我的推荐仍然是:


Firefox 2.0 - http://www.getfirefox.com

Web开发人员扩展 - http://chrispederick.com/work/webdeveloper/

Firebug - https://addons.mozilla.org/firefox/1843/


如果您确实采用了Firefox路线,或者已经安装了它,我建议您使用另一个用户配置文件进行开发
附加组件,因为你几乎肯定最终会使用超过我建议的
,这会让你的标准浏览陷入困境。基本上,尝试

如果可以,不要使用默认配置文件。保持业务与

愉快分开。 :)


希望这会有所帮助。


祝福。


Daz。

There are lots of tools out there fo acheiving this. I think firefox
has built-in support for it. If not, then it''ll be the Web Developer
Extension (by Chris Pederick) that I use, which is (IMHO), an essential
piece of kit, and I can''t imagine how I ever lived without it. You can
use this to view the ''generated source'' as opposed to the static source
that you will see when you click on ''View Source'', which is a hard copy
of the original, that never changes.

Also, firefox has a JavaScript console that you could utilise, although
I use a handy extension called Firebug, which lets you do all sorts of
things, such as inspect the DOM. You could try something like this from
the Firebug console:

var newWindow = open("","");
var theFrame=frames[0].cloneNode(true);
newWindow.appendChild(theFrame);

This should open a new window, take the first frame in your document,
clone it, and place it into the new window document. I think it might
only work with an iframe however, so if they are genuine frames, you
might need move the frame into a frameset on the new document (which I
will leave for you to figure out).

You can also combine the commands into a single line, and prepend
''javascript: '' to it, and then stick it into the address bar, like
this:
javascript: var newWindow = open("",""); var
theFrame=frames[0].cloneNode(true); newWindow.appendChild(theFrame);

This will call upon the JavaScript engine to parse the code you just
sent it. Alternatively, you can do it one line at a time.

However, my recommendation is still:

Firefox 2.0 - http://www.getfirefox.com
Web Developer Extension - http://chrispederick.com/work/webdeveloper/
Firebug - https://addons.mozilla.org/firefox/1843/

If you do take the Firefox route, or already have it installed, I
recommend you make another user profile to use for your development
add-ons as you will almost certainly end up using more than the ones I
suggested, and it will bog down your standard browsing. Basically, try
not to use the default profile if you can. Keep business separate from
pleasure. :)

Hope this helps.

Best wishes.

Daz.


""" Daz写道:

"""
"""Daz wrote:
"""

mistral写道:
mistral wrote:



有谁能告诉我如何在iframe中获取页面的源代码? (弹出窗口

窗口是可点击的图像)。

当我右键单击此弹出边框查看源代码时,我看到

跟随


< html>

< head>

< title>新优惠!< / title>

< / head>

< body style =" margin-left:0%;保证金权利:0%; margin-top:0%;

margin-bottom:0%">

< iframe scrolling =" no" MARGINWIDTH =" 0" MARGINHEIGHT =" 0" frameborder =" 0"

height =" 100%"宽度= QUOT; 100%QUOT;

SRC =" HTTP://ad.yieldmanager.com/iframe3 2gIAAFWkAAATzgIA11UBAAAANAAAAA0AAgABEgACAA HSJgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ABZAAAAAAAAAFkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA FCsI9Z8u8wG6XUHnMRiV9-的Tu6-laFxCGFkmTVwAAAAA = ,, HTTP:// WWW?。 findarticles.com/p/articles/tn_comp/mi_zdpcm/">

< / iframe>

< / body>

< / html>


当我在浏览器中复制iframe网址并尝试获取此页面时,它只是

显示空白页面:


< html>

< body>

<! - 交货记录解码失败,原因= 4(查询字符串

已过期) - >

< / body>

< / html>


As我知道,这是一个动态创建的iframe,并且很难获得它的来源因为iframe源来自不同的

域作为原始页面。是否有一些基于脚本的解决方案(PHP,

javascript)来检索和显示这样的目标iframe源?


谢谢。

---------

Can anybody tell me how to get source code of page in iframe? (popup
window is clickable image).
When I right click on this popup border to view source, i see just as
follows

<html>
<head>
<title>New offer!</title>
</head>
<body style="margin-left: 0%; margin-right: 0%; margin-top: 0%;
margin-bottom: 0%">
<iframe scrolling="no" marginwidth="0" marginheight="0" frameborder="0"
height="100%" width="100%"
src="http://ad.yieldmanager.com/iframe3?2gIAAFWkAAATzgIA11UBAAAANAAAAA0AAgABEgACAA HSJgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ABZAAAAAAAAAFkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA FCsI9Z8u8wG6XUHnMRiV9-Tu6-laFxCGFkmTVwAAAAA=,,http://www.findarticles.com/p/articles/tn_comp/mi_zdpcm/">
</iframe>
</body>
</html>

When i copy iframe url in browser and try to get this page, it just
show empty page:

<html>
<body>
<!-- Delivery record decoding failed with reason = 4 (Query string
expired) -->
</body>
</html>

As far I know, that is a dynamically created iframe, and its difficult
to get it source because the Iframe source comes from a different
domain as the original page. Is there some script-based solution (PHP,
javascript) to retrieve and display target iframe source like this?

Thanks.
---------


有很多工具可以实现这一点。我认为firefox

内置了对它的支持。如果没有,那么它将是我使用的Web开发人员

扩展(由Chris Pederick提供),这是(恕我直言),一个必不可少的
工具包,我无法想象没有它我是如何生活的。您可以使用这个来查看生成的源,而不是单击查看源时看到的静态源

,这是一份硬拷贝原件的b $ b,永远不会改变。
There are lots of tools out there fo acheiving this. I think firefox
has built-in support for it. If not, then it''ll be the Web Developer
Extension (by Chris Pederick) that I use, which is (IMHO), an essential
piece of kit, and I can''t imagine how I ever lived without it. You can
use this to view the ''generated source'' as opposed to the static source
that you will see when you click on ''View Source'', which is a hard copy
of the original, that never changes.


另外,firefox有一个你可以使用的JavaScript控制台,虽然

我使用了一个名为Firebug的便捷扩展,让你做各种各样的事情,比如检查DOM。您可以尝试这样的事情来自Firebug控制台:
Also, firefox has a JavaScript console that you could utilise, although
I use a handy extension called Firebug, which lets you do all sorts of
things, such as inspect the DOM. You could try something like this from
the Firebug console:


var newWindow = open(""," ;");

var theFrame = frames [0] .cloneNode(true);

newWindow.appendChild(theFrame);
var newWindow = open("","");
var theFrame=frames[0].cloneNode(true);
newWindow.appendChild(theFrame);


这应该打开一个新窗口,在文档的第一帧,

克隆它,然后将它放入新窗口文件。我认为可能

只能使用iframe,所以如果它们是真正的帧,你可能需要将帧移动到新文档的框架集中(我

将留给你弄清楚)。
This should open a new window, take the first frame in your document,
clone it, and place it into the new window document. I think it might
only work with an iframe however, so if they are genuine frames, you
might need move the frame into a frameset on the new document (which I
will leave for you to figure out).


您也可以将命令组合成一行,并预先添加

''javascript :''它,然后将其粘贴到地址栏中,例如

这个:

javascript :var newWindow = open(" ;",""); var

theFrame = frames [0] .cloneNode(true); newWindow.appendChild(theFrame);
You can also combine the commands into a single line, and prepend
''javascript: '' to it, and then stick it into the address bar, like
this:
javascript: var newWindow = open("",""); var
theFrame=frames[0].cloneNode(true); newWindow.appendChild(theFrame);


这将调用JavaScript引擎来解析你发送它的代码。或者,您可以一次执行一行。
This will call upon the JavaScript engine to parse the code you just
sent it. Alternatively, you can do it one line at a time.


但是,我的推荐仍然是:
However, my recommendation is still:


Firefox 2.0 - http://www.getfirefox.com

Web开发人员扩展 - http://chrispederick.com/work/webdeveloper/

Firebug - https://addons.mozilla.org/firefox/1843 /


如果您确实采用了Firefox路由,或者已经安装了它,我建议您使用另一个用户配置文件用于您的开发

附加组件,因为您几乎肯定最终会使用超过我建议的
附件,这将使您的标准浏览陷入困境。基本上,尝试

如果可以,不要使用默认配置文件。保持业务与

愉快分开。 :)
If you do take the Firefox route, or already have it installed, I
recommend you make another user profile to use for your development
add-ons as you will almost certainly end up using more than the ones I
suggested, and it will bog down your standard browsing. Basically, try
not to use the default profile if you can. Keep business separate from
pleasure. :)


希望这会有所帮助。
Hope this helps.


祝福。
Best wishes.


Daz。
Daz.



----------


感谢您的建议,Daz。这个工具适用于Firefox浏览器,不幸的是
。我仍然使用IE浏览器。也许用一些服务器

边脚本(PHP或CGI)可以解析这个页面吗?


问候,


Mistral

----------

Thank you for advice, Daz. This tools are for Firefox browser,
unfortunately. I still use IE. Perhaps it''s possible with some server
side script (PHP or CGI), that will parse this page?

Regards,

Mistral


有人能告诉我如何在iframe中获取页面的源代码吗? (弹出
Can anybody tell me how to get source code of page in iframe? (popup

窗口是可点击的图像)。
window is clickable image).



我不确定你是否试图以编程方式实现这一点,

从问题中不清楚,或者如果你只有一个特定的

iframe,你想知道如何查看

的来源,这样你就可以弄清楚发生了什么在那里(或某事)。

如果是这种情况,您是否尝试使用类似Fiddler的东西?

它会监控您的所有http流量。只要你先清除缓存

(在Fiddler中按Ctrl + shift + X),那么所请求的每个文件都将在那里显示为
。您只需突出显示所需的文件请求,在会话检查器上单击

即可。选项卡,然后在TextView上下面的标签

it,然后点击在记事本中查看并打开文件 - 正好是

它被下载了。没有提琴手我不认为我能做我的工作:)

http ://www.fiddlertool.com


它是由微软和免费软件的人写的。你需要安装

..NET框架,但是如果你没有b $ b,它会为你抓住它。

当然,如果我完全错了,而且你正在寻找一些JS来实现这一点,那么跨域安全将会一路打击你。

I''m not sure if you''re trying to programmatically achieve this,
it''s not clear from the question, or if you just have a particular
iframe and you want to figure out how to look at the source of
it so you can figure out what''s going on in there (or something).
If that is the case, have you tried using something like Fiddler?
It monitors all your http traffic. As long as you''ve cleared cache
first (Ctrl+shift+X in Fiddler) then each file requested will be
visible in there. You just highlight the file request you want, click
on the "Session Inspector" tab, then on the "TextView" tab below
it, then click on "View in Notepad" and the file opens - Exactly as
it was downloaded. I don''t think I could do my job without Fiddler:)

http://www.fiddlertool.com

It''s written by someone at Microsoft and freeware. You need the
..NET framework installed, but it''ll grab that for you if you don''t
have it.

Of course if I''m entirely wrong and you''re looking for some JS to
do this, then cross-domain security is going to fight you all the way.


这篇关于获取iFrame的源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆