iMacros: 2021
System: Windows 10 Pro 21H2 19044.1949
With Guru chivracq kind guidance from my earlier post viewtopic.php?f=7&t=32028, i'm able to extract required data with unique element style="background-color: orange;" by using 'Double Relative Positioning' instead of using Xpath.
Since the data table is dynamic with 15mins refresh interval, the total of rows will change from each refresh. I've tried to search for solution & study eval() from the forum posts (especially Guru chivracq solutions) but i'm still not able to grasp the technic somehow
Here again, I hope to have more guidance to find the solution.
Questions:-
1. Is there a way to make a loop instead of the way i'm using as per code below eg. 'Extract 1st rows, 'Extract 2nd rows and so on?
2. The extraction should be stopped when reached <tr class="montage_atm_bottom even", how can i achieve this?
My current code:-
Code: Select all
SET !EXTRACT NULL
TAG POS=1 TYPE=TD ATTR=STYLE:"background-color: orange;"
TAG POS=R-1 TYPE=* ATTR=*
'Extract 1st rows
TAG POS=R1 TYPE=TD ATTR=CLASS:descriptorcell
TAG POS=R1 TYPE=A ATTR=CLASS:montagelink EXTRACT=TXT
TAG POS=R1 TYPE=TD ATTR=CLASS:rightcelltd<SP>volcell EXTRACT=TXT
TAG POS=R1 TYPE=TD ATTR=CLASS:rightcelltd<SP>volcell EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\Desktop FILE=test_{{!NOW:yymmdd_hhnn}}.csv
'Extract 2nd rows
TAG POS=R1 TYPE=TD ATTR=CLASS:descriptorcell
TAG POS=R1 TYPE=A ATTR=CLASS:montagelink EXTRACT=TXT
TAG POS=R1 TYPE=TD ATTR=CLASS:rightcelltd<SP>volcell EXTRACT=TXT
TAG POS=R1 TYPE=TD ATTR=CLASS:rightcelltd<SP>volcell EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\Desktop FILE=test_{{!NOW:yymmdd_hhnn}}.csv
'Extract 3rd rows
TAG POS=R1 TYPE=TD ATTR=CLASS:descriptorcell
TAG POS=R1 TYPE=A ATTR=CLASS:montagelink EXTRACT=TXT
TAG POS=R1 TYPE=TD ATTR=CLASS:rightcelltd<SP>volcell EXTRACT=TXT
TAG POS=R1 TYPE=TD ATTR=CLASS:rightcelltd<SP>volcell EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\Desktop FILE=test_{{!NOW:yymmdd_hhnn}}.csv
'Extract 4th rows...
'Extract 5th rows...