Avatar of kcg-witchdoctor
kcg-witchdoctor asked on

Is it possible to Parse iframe content? Either with HTA's , javascript or some other method?

I have a web app that shows input boxes that on submit insert a record into a database. Next to the column of text boxes is an iframe that contains a web page on a remote site, that we cut copy and paste numbers into the text boxes. I wish to auto populate my text boxes by parsing the content in the iframe.
I have purchased the commercial version of ASP tear to return the content as a string for parsing, but haven't had much luck getting it work. Since the iframe uses cookies from other tabs in IE7. The ASP tear component executes on the server, which means it can't' make use of the cookies on the client browser. So i am leaning away from it.
My goal is parse the contents of an iframe. Other experts in a similar question suggested using HTAs but i am unfamiliar with them. Anybody have an example of how to accomplish parsing of iframes using HTAs or javascript?
JavaScriptWeb Applications

Avatar of undefined
Last Comment

8/22/2022 - Mon

In the <iframe> tag you put an onLoad event handler of the iframe.
That event handler function can check for the expected form and fields and access every field of the form and transfer it to any location on parent page or another iframe where you want. No need for extra page graber software and html parsing. The fields of the iframe form are accessed by regular DOM (document object model) scripting elements.

The content that the iframe contains isn't within forms, I wish it was. It is a simple html page. Is there a way to refernce the content without using DOM? For instace just the content or the html source which i can then strip all tags out of?

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

You are the Man, Thank you!!!
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck

And in IE (because of HTA) you can stript the tags like this:

var thePage = window.frames.yourIframeNAME.document.body.innerText;