Reading out the contents of an iframe fails

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
JosefR
Newbie
Posts: 3
Joined: Wed Mar 14, 2018 1:50 pm

Reading out the contents of an iframe fails

Post by JosefR » Wed Mar 14, 2018 2:16 pm

Hello,

I am currently evaluating Macro Scheduler and I have in vain been trying to read out the contents of an iframe, which is inside one of the web sites that I want to manage with MS. Unfortunately, there is very little on this forum related to iframes and the doc is also quite sparse.

I have tried about 15 different syntax variants but none of them works, neither for the entire iframe what would be the preferred solution, nor for any element within the iframe. For all other objects it works well. It is always the entire outer html exported but without the contents of the iframe. I tried to use the id, the class in different syntaxes, but no way!

I spent almost a day on this and therefore my question Is it AT ALL possible to read out an iframe with its contents and if so, what is the preferred syntax. My iframe has an id. I am using IEExtractTag and this same command works perfectly well with several other tag that are not inside this iframe.

I am on Win7 using IE11.

Best regards
Josef

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Reading out the contents of an iframe fails

Post by Marcus Tettmar » Wed Mar 14, 2018 3:02 pm

The answer is it depends. There are security implications with some iframes. If you are able to share the URL with me privately I will happily take a look and see if I can send you a solution. Please email support AT mjtnet.com
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

JosefR
Newbie
Posts: 3
Joined: Wed Mar 14, 2018 1:50 pm

Re: Reading out the contents of an iframe fails

Post by JosefR » Wed Mar 14, 2018 3:14 pm

Hello,

and thank you for the quick reply. Unfortunately, I cannot provide a link as this is behind my customers firewall.

But could you be so kind to let me know the setting or command, which would make the iframe protected. Then I could look for it myself. I can see all the contents in the inspector.

Thank you in advance.

Josef

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Reading out the contents of an iframe fails

Post by Marcus Tettmar » Thu Mar 15, 2018 7:17 pm

The most obvious issue is if the frame content is on a different domain. But there could be other reasons and sometimes it's hard to say what the issue is. Usually there's a way to get the data, but without being able to "play" with it I can't really help. Perhaps we could schedule a screen share session and we could help that way. If you'd like to do that please contact me via the help desk.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

JosefR
Newbie
Posts: 3
Joined: Wed Mar 14, 2018 1:50 pm

Re: Reading out the contents of an iframe fails

Post by JosefR » Fri Mar 23, 2018 4:28 pm

Hello,

sorry for the late reply but I saw my customer only yesterday and after I explained the details they decided to pursue a technically different way.

Sorry and Greetings
J.

tommykent
Newbie
Posts: 1
Joined: Thu May 17, 2018 7:31 pm

Re: Reading out the contents of an iframe fails

Post by tommykent » Thu May 17, 2018 7:38 pm

Hi,
I am having a similar issue. Most of what I want to automate is included within an iframe. My macro is unable to find any of the tags, just like the gentleman found above.
I submitted a support request I think, but I wanted to post here as well.

It would be great to get a solution for this. I did see someone post in this forum from years ago regarding VBS scripting and iFrames. Pending a solution, I will likely purchase the product since MacroScheduler seems to have many more automation options. (like scheduling for 4 macros to run simultaneously on 4 different IE browser instances)
This is a time sensitive project for a client, so I would appreciate a timely response. Thank you for your time.

Best,

Tommy

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Reading out the contents of an iframe fails

Post by Marcus Tettmar » Mon May 21, 2018 10:31 am

Some frames are easy, some are a nightmare. Some are across different domains and present security issues. Some don't have names, some have static URLs some have dynamic ones. There is a plethora of permutations that can affect how easy it is or not to automate.

The WebRecorder functions allow you to specify the frame name. If you don't specify the frame name they should iterate through all frames and find the first match.

The functions which take a URL can be given the URL of the frame. So if you can identify that you can treat it as if it is a parent frame, just by giving the function the URL (or partial - but be sure to make sure it only matches the frame you want) of the frame.

Frames may fox the wizards, but you may still be able to automate them - you might just have to identify the element IDs and attributes manually:
https://help.mjtnet.com/article/13-find ... -web-sites

Sometimes you can even Navigate the main window to the frame URL. Find the URL of the frame and then issue an IENavigate. Then the parent window is ONLY the frame you want to automate, thus simplifying detection and automation. Won't work with frames which have some kind of javascript dependence on another frame but may work in other cases and it is a technique I've used many times.

So many variations, so many different sites, no one single answer.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts