Getting source code of iFrame

M

mistral

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?...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.
 
D

Daz

mistral said:
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?...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.

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.
 
M

mistral

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

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?...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.
---------
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:
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.
----------

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
 
D

dd

Can anybody tell me how to get source code of page in iframe? (popup
window is clickable image).

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.
 
M

mistral

"""dd wrote:
"""
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:)

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.
-------------------

I just want to look at the html source of a few particular iframes, so
need way get it. I have not tried Fiddler yet.
But I find some tool that can do this, it seems - 'IE Source'. It's
browser helper object for IE, will try it first.

http://www.softcab.com/ie_source/index.php

thanks,

Mistral
 
M

mistral

"""Evertjan. wrote:
"""
mistral wrote on 16 jan 2007 in comp.lang.javascript:
rightclick -> source
------

Not possible.. You canno get source without some special tool since it
just flash or gif image, dynamically generated iframe that comes from a
different domain as the original page.

Mistral
 
E

Evertjan.

mistral wrote on 17 jan 2007 in comp.lang.javascript:
Not possible.. You canno get source without some special tool since it
just flash or gif image,

So your Q is wrong, you asked for the "html source".
dynamically generated iframe that comes from a
different domain as the original page.

It does not matter how it is generated, meseems.

If it is not from the same domain,
it has either to have a html source or it is not html.

===========================================================

Let me test:

<iframe href='http://cnn.com/'></iframe>

rightclick -> source YES!!!

<iframe src=
'http://i.a.cnn.net/cnn/.element/img/1.5/ceiling/nav.rt.end.bg_over.gif'>
</iframe>

No html
rightclick -> NO source

stands to reason.
 
M

mistral

"""Evertjan. wrote:
"""
mistral wrote on 17 jan 2007 in comp.lang.javascript:
mistral wrote on 16 jan 2007 in comp.lang.javascript:
I just want to look at the html source of a few particular iframes,
Not possible.. You canno get source without some special tool since it
just flash or gif image,
dynamically generated iframe that comes from a
different domain as the original page.
If it is not from the same domain,
it has either to have a html source or it is not html.

Let me test:
<iframe href='http://cnn.com/'></iframe>
rightclick -> source YES!!!
No html
rightclick -> NO source
stands to reason.
--------------

well. Let's try this: got to the following links:

http://www.findarticles.com/p/articles/mi_m0HUL/is_3_34/ai_n8967611

http://findarticles.com/p/articles/tn_comp

you should get popup from "http://ads-rm.looksmart.com - New offer!..."

When right click on this ads, it just show image source:

http://spe.atdmt.com/b/NFNFXNFLXNFX/0205_010_H_720300_A_70.gif

Try get they html source code use IE (not Firefox) and explain me how
to do this.

It interesting that IE popup blocker bar show "Pop-up blocked".. but it
can no block this popups..


mistral
 
R

Randy Webb

mistral said the following on 1/17/2007 10:29 AM:

well. Let's try this: got to the following links:

http://www.findarticles.com/p/articles/mi_m0HUL/is_3_34/ai_n8967611

http://findarticles.com/p/articles/tn_comp

you should get popup from "http://ads-rm.looksmart.com - New offer!..."

When right click on this ads, it just show image source:

http://spe.atdmt.com/b/NFNFXNFLXNFX/0205_010_H_720300_A_70.gif

Try get they html source code use IE (not Firefox) and explain me how
to do this.

Context Menu Key, View Source. Very simple.
 
M

mistral

"""Randy Webb wrote:
"""
mistral said the following on 1/17/2007 10:29 AM:
Context Menu Key, View Source. Very simple.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
----------------------


what source you meant? I am talking about popup ads source. it show for
me when right click on boder:

<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?...=,,http://findarticles.com/p/articles/tn_comp"></iframe></body></html>


m.
 
M

mistral

"""Randy Webb wrote:
"""
mistral said the following on 1/17/2007 10:29 AM:
----------------
Context Menu Key, View Source. Very simple.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

-------

not sure what source you mean. I am speaking about popup ads source,
not about source of main page..
when right click on ads boder it show:

<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?2gIAAFWkAAATzgIA11UBAAAAKAAAAAsAAw..."></iframe></body></html>


where is source?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,069
Latest member
SimplyleanKetoReviews

Latest Threads

Top