473,386 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Getting source code of 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.

Jan 14 '07 #1
12 11103
Daz

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

Jan 14 '07 #2
"""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?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.
---------
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.
----------

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

Jan 14 '07 #3
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.

Jan 16 '07 #4
"""dd wrote:
"""
>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.
-------------------

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

Jan 16 '07 #5
mistral wrote on 16 jan 2007 in comp.lang.javascript:
I just want to look at the html source of a few particular iframes,
rightclick -source

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 16 '07 #6

"""Evertjan. wrote:
"""
mistral wrote on 16 jan 2007 in comp.lang.javascript:
I just want to look at the html source of a few particular iframes,
rightclick -source
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
------

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

Jan 16 '07 #7
mistral wrote on 17 jan 2007 in comp.lang.javascript:
Evertjan. wrote:
>mistral wrote on 16 jan 2007 in comp.lang.javascript:
I just want to look at the html source of a few particular iframes,
>rightclick -source

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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 17 '07 #8

"""Evertjan. wrote:
"""
mistral wrote on 17 jan 2007 in comp.lang.javascript:
>Evertjan. wrote:
mistral wrote on 16 jan 2007 in comp.lang.javascript:
I just want to look at the html source of a few particular iframes,
>rightclick -source
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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
--------------

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

http://www.findarticles.com/p/articl...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/...20300_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

Jan 17 '07 #9
mistral wrote on 17 jan 2007 in comp.lang.javascript:
>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.gi
f'</iframe>
>No html
rightclick -NO source
>stands to reason.

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

http://www.findarticles.com/p/articl...34/ai_n8967611
I will try only this one:

Terrible code, mixture if javascript with and without version,
all spammy advertisements, two flash players.

I am not going to test that.

Please make your own minimal problem.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 17 '07 #10
mistral said the following on 1/17/2007 10:29 AM:

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

http://www.findarticles.com/p/articl...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/...20300_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.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 17 '07 #11

"""Randy Webb wrote:
"""
mistral said the following on 1/17/2007 10:29 AM:
<snip>
well. Let's try this: got to the following links:
http://www.findarticles.com/p/articl...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/...20300_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.
--
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?2gIAAFWkAAATzgIA11UBAAAAKAAAAAsAAwAEEwACAA HSJgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ABZAAAAAAAAAFkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA DcyKIMM19wE24oHCEsUEa8DbrY6RPDfSzLsQxgAAAAA=,,http ://findarticles.com/p/articles/tn_comp"></iframe></body></html>
m.

Jan 17 '07 #12

"""Randy Webb wrote:
"""
mistral said the following on 1/17/2007 10:29 AM:
<snip>
well. Let's try this: got to the following links:
http://www.findarticles.com/p/articl...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/...20300_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.
--
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?

Jan 17 '07 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: TCMA | last post by:
I am looking for some tools to help me understand source code of a program written in C++ by someone else. Are there any non-commercial, open source C or C++ tools to reverse engineer C or C++...
2
by: Guoqi Zheng | last post by:
Dear sir, I am writting an WYSIWYG html editor, I need to get the html source code out of an iframe. I know I can use innerhtml or innertext. But that will remvoe the html header info which is...
2
by: SourceChallenged | last post by:
Can anyone point me in the right direction to extract my source files from a DLL. I had a hard drive crash on my dev machine and was not using source safe ( boo ) On the webserver I had just my...
1
by: syshex | last post by:
Hi everyone ! I'm really new to javascript, and am possibly aiming quite high already, but still I feel I just satisfy my curiosity and ask you all this question. I've got this really really...
7
by: sandy | last post by:
hello can anbody help me in getting source code for tcp/ip stack in ANSI C or source code for http protocol
1
by: tussi | last post by:
how can i obtain source code of a software or executable file written in any language......... plz help me
66
by: Jon Skeet [C# MVP] | last post by:
I'm sure the net will be buzzing with this news fairly soon, but just in case anyone hasn't seen it yet: Microsoft are going to make the source code for the .NET framework (parts of it,...
10
by: Tomás Ó hÉilidhe | last post by:
I'd post this on a gcc newsgroup but I'd be more productive talking to the wall. Anyway, let's say someone throws some source code at you for a particular program and says, "Just compile it, it...
1
by: codejunkie | last post by:
Iframe is generated on my page by a script like this... <script src="http://example.com/make_iframe"></script> How can I get the source code of the generated iframe (or the URL of it)? Help...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.