extract content from iframe and store it into a variable

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

extract content from iframe and store it into a variable

by yoli on Tue Mar 14, 2017 2:19 am

I have the following html element and I want to extract the "src" attribute's value(/something/something.csv)
Code: Select all
<iframe title="my iFrame" class="aamIframeLoaded" id="destination_publishing_iframe_0" src="/something/something.csv" style="width: 0px; height: 0px; display: none;" sandbox="allow-scripts allow-same-origin"></iframe>


if the extraction is possible I want to implement the following pseudo code:

Code: Select all
get iframe src attribute's value and store it into 'url' variable
URL GOTO=https://mywebsite.com + url


Is this possible? if so how can I do it?

Thanks,
yoli
 
Posts: 12
Joined: Fri Jun 24, 2016 4:15 am

Re: extract content from iframe and store it into a variable

by chivracq on Tue Mar 14, 2017 10:17 pm

yoli wrote:I have the following html element and I want to extract the "src" attribute's value(/something/something.csv)
Code: Select all
<iframe title="my iFrame" class="aamIframeLoaded" id="destination_publishing_iframe_0" src="/something/something.csv" style="width: 0px; height: 0px; display: none;" sandbox="allow-scripts allow-same-origin"></iframe>


if the extraction is possible I want to implement the following pseudo code:

Code: Select all
get iframe src attribute's value and store it into 'url' variable
URL GOTO=https://mywebsite.com + url


Is this possible? if so how can I do it?

Thanks,


- Extract 'src' attribute of an iFrame
yoli wrote:Hi,

I'm using iMacro .net component 10.1 and I have the following element:
Code: Select all
<iframe title="Adobe ID Syncing iFrame" class="aamIframeLoaded" id="destination_publishing_iframe_vmwareinc_0" src="/custrpts/rptrepo/export/License_Keys_2017031503430860_GMT.csv" style="width: 0px; height: 0px; display: none;" sandbox="allow-scripts allow-same-origin"></iframe>


and I want to extract attribute 'src' content by:

Code: Select all
TAG POS=1 TYPE=IFRAME ATTR=ID:destination_publishing_iframe_vmwareinc_0 EXTRACT=TXT


But the command failed.

any ideas?

Thanks,

Hum..., I don't think that spamming the Forum by opening Duplicate Threads every day is the way to get some Help...! :roll:

I was hesitating to react to your Thread (this one) as you didn't mention your FCI again (I've already asked you before, and it was already a bit of a hassle to get that Info), + you didn't follow up anymore (again) and didn't finished your previous Thread a bit neatly and useful for other Users while I already had to ask you in your previous Thread to follow up on your previous-previous Thread for me to help you, you complied, I did some Extended Research for you and helped you..., and you "disappeared"...
I guess now you'll be motivated again for this current Pb of yours as you sound a bit desperate and you'll post some mini-fake-Update in the older Thread but I don't feel to go digging again in that previous Thread...
=> I'll pass on that one, good luck with other (Advanced) Users (your current Qt/Pb is not difficult, it takes me a few Secs to find 2-3-4 Solutions), the Duplicate Thread has been reported to be deleted (or merged eventually if sbd replies in it) by the Forum Admin (I cannot do it myself), but hum..., if you are using the Dot.Net Component, you must must have some Support License and have direct Access to TechSup (and they are much nicer than me, ah-ah...! 8) ).

But, hum, would be nice if you could use the Forum a bit correctly, it would make everybody's Life a bit easier... :idea:
(And you would already have gotten your Answer 20h ago...)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6489
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: extract content from iframe and store it into a variable

by chivracq on Wed Mar 15, 2017 11:44 am

Hum, seems like you are "lucky", some new User tried to post a Reply, but Post was not approved because posted in the Duplicate Thread that I would like you to delete/will be deleted by Forum Admin, and Post contains some religious Comment (removed)...

Re: Extract 'src' attribute of an iFrame

Posted by MuslimPerson on 15 Mar 2017, 18:42

my first replay in the forum :wink:

is there other iframes ?

whatever if there are many iframes you can select what you want by "POS=1,2,3,etc.." ...

Try this:
Code: Select all
TAG POS=1 TYPE=IFRAME ATTR=* EXTRACT=HTM
SET !EXTRACT EVAL("'{{!EXTRACT}}'.match(/src=[\"'](.+?)[\"']/)[1];")


in your case , now !EXTRACT = /custrpts/rptrepo/export/License_Keys_2017031503430860_GMT.csv

[Religious Comment removed by Moderator.]
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6489
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to General Support & Discussions

Who is online

Users browsing this forum: Bing [Bot] and 4 guests

-->