nada

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
freeav8
Posts: 14
Joined: Fri Mar 25, 2011 4:30 pm

nada

Post by freeav8 » Thu Apr 07, 2011 12:00 am

deleted
Last edited by freeav8 on Sat Jul 02, 2011 3:20 pm, edited 5 times in total.
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: Extract with "IF" loop

Post by MattBell7 » Thu Apr 07, 2011 3:49 pm

2 options i can think of.

One, select your element using EXTRACT=HTM then interrogate the extract for your color.

for an example of the extract content run:

Code: Select all

URL GOTO=https://www15.swalife.com/PortalWeb/cwa.jsp?test=test     
FRAME F=2     
TAG POS=1 TYPE=DIV ATTR=CLASS:swaFormNote   EXTRACT=HTM 
or, a better option would be to try something like:

Code: Select all

TAG POS=1 TYPE=TR ATTR=CLASS:disabledRow&&TXT:*OP31/06*
this should select a row that has that CSS class and that text.

as for the loop, check the wiki on looping for all the info you need.
freeav8
Posts: 14
Joined: Fri Mar 25, 2011 4:30 pm

nada

Post by freeav8 » Thu Apr 07, 2011 8:15 pm

deleted
Last edited by freeav8 on Sat Jul 02, 2011 3:30 pm, edited 3 times in total.
jbwocky
Posts: 24
Joined: Fri Aug 28, 2009 7:36 am

Re: Extract with "IF" loop

Post by jbwocky » Fri Apr 08, 2011 6:01 am

Hi,

I've had a similar situation recently. My script had to wait until a certain menu appeared on screen. So, what I did, was a different type of javascript loop. This is the syntax:

do {
//extract the htm of the menu
//check if the htm contains the word "disabled" <-- in your case this would be the color
if (the menu appears) {
break; //break the loop
}

} while (there is no menu)
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: Extract with "IF" loop

Post by MattBell7 » Fri Apr 08, 2011 7:39 am

first this, check if this will actually select the row

TAG POS=1 TYPE=TD ATTR=TXT:Pairing
TAG POS=R1 TYPE=TR ATTR=CLASS:disabledRow
TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT

If that works (which i think it should)

Then have your script do the following (its pseudo code)

Open Browser
errorList = empty array
count=0
Do Until Error
count++
iimSet("-var_count",count)
iimPlay("Macro from above")
extr=iimGetLastExtract()
if (extr is NOT in errorList) {
add it
do whatever you want to do with it, if you need further rows run an extract row
}
loop

(you'll need to change the macro by changing the first R1 to R{{count}}
freeav8
Posts: 14
Joined: Fri Mar 25, 2011 4:30 pm

nada

Post by freeav8 » Fri Apr 08, 2011 3:08 pm

deleted
Last edited by freeav8 on Sat Jul 02, 2011 3:25 pm, edited 3 times in total.
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: Extract with "IF" loop

Post by MattBell7 » Mon Apr 11, 2011 8:52 am

ah, i use the full version, so script in vbs or java. with the imacros extension you can script in JS:

http://wiki.imacros.net/iMacros_for_Fir ... _Interface
freeav8
Posts: 14
Joined: Fri Mar 25, 2011 4:30 pm

nada

Post by freeav8 » Tue Apr 12, 2011 7:35 pm

deleted
Last edited by freeav8 on Sat Jul 02, 2011 3:28 pm, edited 3 times in total.
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: Extract with "IF" loop

Post by MattBell7 » Wed Apr 13, 2011 7:58 am

does Get DOT Trip actually work?

when it runs, do you see it select you're element?
freeav8
Posts: 14
Joined: Fri Mar 25, 2011 4:30 pm

nada

Post by freeav8 » Sat Apr 16, 2011 8:18 pm

deleted
Last edited by freeav8 on Sat Jul 02, 2011 3:27 pm, edited 2 times in total.
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: Extract with "IF" loop

Post by MattBell7 » Tue Apr 19, 2011 4:23 pm

try this for the extract:

Code: Select all

TAG POS=1 TYPE=TR ATTR=CLASS:disabledRow
TAG POS=R1 TYPE=TD ATTR=CLASS:tripDateCol EXTRACT=TXT
freeav8
Posts: 14
Joined: Fri Mar 25, 2011 4:30 pm

nada

Post by freeav8 » Wed Apr 20, 2011 4:25 pm

deleted
Last edited by freeav8 on Sat Jul 02, 2011 3:26 pm, edited 2 times in total.
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: Extract with "IF" loop

Post by MattBell7 » Wed Apr 20, 2011 4:44 pm

hmmmm, if i use your html and the macro code posted, it extracts perfectly for me.
try running the 2 lines on their own within IE, and see if it selects it. it could be something else in your macro is throwing it out, but am a bit confused why it wouldn't work.

you need both lines, as what it will do is select the row with a class of disabledRow then select the next tripDateCol and extract it.

is there anyway i can get access to your system to see if theres something i'm not understanding properly.
freeav8
Posts: 14
Joined: Fri Mar 25, 2011 4:30 pm

nada

Post by freeav8 » Wed Apr 20, 2011 6:05 pm

deleted
Last edited by freeav8 on Sat Jul 02, 2011 3:25 pm, edited 2 times in total.
freeav8
Posts: 14
Joined: Fri Mar 25, 2011 4:30 pm

nada

Post by freeav8 » Thu Apr 21, 2011 2:00 pm

deleted
Last edited by freeav8 on Sat Jul 02, 2011 3:23 pm, edited 2 times in total.
Post Reply