Extract variable from output table to select hyperlink

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
Post Reply
GreatCornholio
Posts: 5
Joined: Sun Nov 29, 2020 5:20 pm

Extract variable from output table to select hyperlink

Post by GreatCornholio » Sun Nov 29, 2020 5:44 pm

roblem Description Information:
1. iMacros Version: iMacros Personal Edition for Firefox 8.9.7 (VERSION BUILD=10021450)
2. Windows 10 (64-bit) [English]
3. Firefox 83
4. Included demos work ok.
5. Included VBS sample scripts run ok.
6. Not applicable/no specific recording or replay fails on a specific website.
7. Not applicable/no test for encounter of the same problem with the: iMacros Browser, iMacros for Internet Explorer, iMacros for Firefox, and iMacros for Chrome.

Problem:
I am trying to write an iMacros script that loads a webpage, fills out a form with the required attributes, searches, and from the search output table select a hyperlinked identifier (that changes every day) to open the page that allows me to download the CSV I need.

Ive managed to write the script to populate the form and search to produce the output I want to select. In the output table (attached capture) I want to select the hyperlinked value underneath 'OutpudId'. This I can do if I explicitly tell the script what to select but it changes everyday and I want the script to by dynamic to find the value in that position to then be able to select it day in day out.

section of code:

Code: Select all

VERSION BUILD=10021450
URL GOTO=https://website.com/#/

TAG POS=1 TYPE=SELECT ATTR=ID:select-program-name CONTENT=%string:Merchant
TAG POS=1 TYPE=BUTTON ATTR=ID:add-iogls-button
TAG POS=1 TYPE=SELECT ATTR=TXT:1188233-HUK-UGL* CONTENT=%string:HUK
TAG POS=1 TYPE=BUTTON ATTR=TXT:Select
TAG POS=1 TYPE=INPUT:DATE ATTR=ID:startDate  CONTENT= EVAL("var d=new Date();d.setDate(d.getDate()-1);var year=d.getFullYear();var month=d.getMonth()+1;var day=d.getDate();year+'-'+month+'-'+day;")   ---select yesterday
TAG POS=1 TYPE=BUTTON ATTR=ID:download_button
TAG POS=1 TYPE=A ATTR=TXT:a0451cb7 ---- this is the variable I want to select. Hardcoded selects it but it changes every time the form is submitted

Ive attempted to use Extract in different ways to no success. Please see below:

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:OutputId* EXTRACT=OutputId
TAG POS=1 TYPE=A ATTR=TXT:OutputId
or

Code: Select all

TAG POS=1 TYPE=TH ATTR=TXT:OutputId EXTRACT=TXT
Any help would be greatly appreciated
Capture.JPG
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extract variable from output table to select hyperlink

Post by chivracq » Sun Nov 29, 2020 6:08 pm

GreatCornholio wrote:
Sun Nov 29, 2020 5:44 pm
roblem Description Information:

Code: Select all

1. iMacros Version: iMacros Personal Edition for Firefox 8.9.7 (VERSION BUILD=10021450)
2. Windows 10 (64-bit) [English]
3. Firefox 83
4. Included demos work ok.
5. Included VBS sample scripts run ok.
6. Not applicable/no specific recording or replay fails on a specific website.
7. Not applicable/no test for encounter of the same problem with the: iMacros Browser, iMacros for Internet Explorer, iMacros for Firefox, and iMacros for Chrome.

Problem:
I am trying to write an iMacros script that loads a webpage, fills out a form with the required attributes, searches, and from the search output table select a hyperlinked identifier (that changes every day) to open the page that allows me to download the CSV I need.

Ive managed to write the script to populate the form and search to produce the output I want to select. In the output table (attached capture) I want to select the hyperlinked value underneath 'OutpudId'. This I can do if I explicitly tell the script what to select but it changes everyday and I want the script to by dynamic to find the value in that position to then be able to select it day in day out.

section of code:

Code: Select all

VERSION BUILD=10021450
URL GOTO=https://website.com/#/

TAG POS=1 TYPE=SELECT ATTR=ID:select-program-name CONTENT=%string:Merchant
TAG POS=1 TYPE=BUTTON ATTR=ID:add-iogls-button
TAG POS=1 TYPE=SELECT ATTR=TXT:1188233-HUK-UGL* CONTENT=%string:HUK
TAG POS=1 TYPE=BUTTON ATTR=TXT:Select
TAG POS=1 TYPE=INPUT:DATE ATTR=ID:startDate  CONTENT= EVAL("var d=new Date();d.setDate(d.getDate()-1);var year=d.getFullYear();var month=d.getMonth()+1;var day=d.getDate();year+'-'+month+'-'+day;")   ---select yesterday
TAG POS=1 TYPE=BUTTON ATTR=ID:download_button
TAG POS=1 TYPE=A ATTR=TXT:a0451cb7 ---- this is the variable I want to select. Hardcoded selects it but it changes every time the form is submitted

Ive attempted to use Extract in different ways to no success. Please see below:

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:OutputId* EXTRACT=OutputId
TAG POS=1 TYPE=A ATTR=TXT:OutputId
or

Code: Select all

TAG POS=1 TYPE=TH ATTR=TXT:OutputId EXTRACT=TXT
Any help would be greatly appreciated

Capture.JPG

Hum, "1. iMacros Version: iMacros Personal Edition for Firefox 8.9.7 (VERSION BUILD=10021450)" is a bit incompatible, it will be either "iMacros for FF v8.9.7" or "iMacros for FF v10.0.2 'PE'", => v10.0.2 for FF if using FF83 as v8.9.7 for FF doesn't work on FF83. :wink:

OK, try this one...:

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:OutputId*
TAG POS=R6 TYPE=A ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_
... or this one...:

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:OutputId*
TAG POS=R6 TYPE=TD ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_
... or this one...:

Code: Select all

TAG POS=1 TYPE=TH ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R5 TYPE=A ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_
... or this one...:

Code: Select all

TAG POS=1 TYPE=TH ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R5 TYPE=TD ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_
... I expect all 4 Variants to work...

If the Column Header(s) is/are clickable, you will need to prevent the Click on the Header..., => only applied to the first Script, that would give...:

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:OutputId* EXTRACT=TXT
SET !EXTRACT NULL
TAG POS=R6 TYPE=A ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
GreatCornholio
Posts: 5
Joined: Sun Nov 29, 2020 5:20 pm

Re: Extract variable from output table to select hyperlink

Post by GreatCornholio » Sun Nov 29, 2020 7:37 pm

Thanks for the quick response. Id like to say the incorrect firefox version below was a test but I must admit when trying to solve this challenge myself I was reviewing topics on the forum and had taken the format from a well structured question, I must've forgotten to update this snippet.

Sadly the 4 scripts you have provided don't work, they get stuck trying to find the first tag. Error code below:


"RuntimeError: element TD specified by TXT:OutputId* was not found, line: 3"


I have used the record macro to grab more specific information form the table in question, I hope this helps solve:

Code: Select all

TAG POS=1 TYPE=TR ATTR=TXT:2020-11-29<SP>2020-11-28T21:02:19.758<SP>NORMAL-7-HUK5<SP>PR*
TAG POS=3 TYPE=DIV ATTR=TXT:Run<SP>For<SP>Date<SP>Time<SP>of<SP>Run<SP>FcType<SP>IOGL*
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extract variable from output table to select hyperlink

Post by chivracq » Sun Nov 29, 2020 8:10 pm

GreatCornholio wrote:
Sun Nov 29, 2020 7:37 pm
Thanks for the quick response. Id like to say the incorrect firefox version below was a test but I must admit when trying to solve this challenge myself I was reviewing topics on the forum and had taken the format from a well structured question, I must've forgotten to update this snippet.

Sadly the 4 scripts you have provided don't work, they get stuck trying to find the first tag. Error code below:


"RuntimeError: element TD specified by TXT:OutputId* was not found, line: 3"


I have used the record macro to grab more specific information form the table in question, I hope this helps solve:

Code: Select all

TAG POS=1 TYPE=TR ATTR=TXT:2020-11-29<SP>2020-11-28T21:02:19.758<SP>NORMAL-7-HUK5<SP>PR*
TAG POS=3 TYPE=DIV ATTR=TXT:Run<SP>For<SP>Date<SP>Time<SP>of<SP>Run<SP>FcType<SP>IOGL*

Hum, then you need to record tagging the "OutputId" Col-Header, => I would expect stg like:

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:OutputId
... but apparently that's not correct...

... Or try recording clicking on the whole Header (the whole Row), which

Code: Select all

TAG POS=1 TYPE=TH ATTR=TXT:*Type*OutputId*RunId*
... was supposed to do..., but maybe it is "TYPE=TR" also, instead of "TYPE=TH", I cannot test myself...

>>>

Or post the Full Content of the 'EXTRACT' from:

Code: Select all

TAG POS=1 TYPE=TABLE ATTR=* EXTRACT=HTM
... => Then I will be able to see the complete HTML Structure of the Table... :P
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
GreatCornholio
Posts: 5
Joined: Sun Nov 29, 2020 5:20 pm

Re: Extract variable from output table to select hyperlink

Post by GreatCornholio » Mon Nov 30, 2020 9:29 am

Some good news, changing to Type TR does allow the script to move to the next line. Section that runs below:

Code: Select all

TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
However as we move to the next part, selecting/clicking that OutputId instead it pulls back "#EANF#" in the extract dialogue instead of desired output ID of "f0f7c33e". Code below:

Code: Select all

TAG POS=R6 TYPE=A ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_

Good thinking, please see full content of the extract below:

<table id="runs-table" class="table"> <thead class="thead-inverse"> <tr> <th>Run For Date</th> <th>Time of Run</th> <th>FcType IOGL</th> <th>Type</th> <th>OutputId</th> <th>RunId</th> </tr> </thead> <!-- ngRepeat: entry in popCtrl.fabRunListFiltered = (fabRunList | startFrom:popCtrl.currentPage*popCtrl.rows_requests | limitTo : popCtrl.rows_requests) --><tbody ng-repeat="entry in popCtrl.fabRunListFiltered = (fabRunList | startFrom:popCtrl.currentPage*popCtrl.rows_requests | limitTo : popCtrl.rows_requests)" class="ng-scope"> <tr> <td class="ng-binding">2020-11-30</td> <td class="ng-binding">2020-11-29T21:02:20.942</td> <td class="ng-binding">NORMAL-7-HUK5</td> <td class="ng-binding">PRODUCTION</td> <td><a href="/#/run-details/f0f7c33e/159a11e8-723a-4394-8fdd-588765fb8a66" class="ng-binding">f0f7c33e</a></td> <td class="ng-binding">159a11e8-723a-4394-8fdd-588765fb8a66</td> </tr></tbody><!-- end ngRepeat: entry in popCtrl.fabRunListFiltered = (fabRunList | startFrom:popCtrl.currentPage*popCtrl.rows_requests | limitTo : popCtrl.rows_requests) --> </table>


Many thanks
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extract variable from output table to select hyperlink

Post by chivracq » Mon Nov 30, 2020 10:56 am

GreatCornholio wrote:
Mon Nov 30, 2020 9:29 am
Some good news, changing to Type TR does allow the script to move to the next line. Section that runs below:

Code: Select all

TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
However as we move to the next part, selecting/clicking that OutputId instead it pulls back "#EANF#" in the extract dialogue instead of desired output ID of "f0f7c33e". Code below:

Code: Select all

TAG POS=R6 TYPE=A ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_

Good thinking, please see full content of the extract below:

Code: Select all

<table id="runs-table" class="table">
     <thead class="thead-inverse">
          <tr>
               <th>Run For Date</th>
               <th>Time of Run</th>
               <th>FcType IOGL</th>
               <th>Type</th>
               <th>OutputId</th>
               <th>RunId</th>
          </tr>
     </thead>
     <!-- ngRepeat: entry in popCtrl.fabRunListFiltered = (fabRunList | startFrom:popCtrl.currentPage*popCtrl.rows_requests | limitTo : popCtrl.rows_requests) -->
     <tbody ng-repeat="entry in popCtrl.fabRunListFiltered = (fabRunList | startFrom:popCtrl.currentPage*popCtrl.rows_requests | limitTo : popCtrl.rows_requests)" class="ng-scope">
          <tr>
               <td class="ng-binding">2020-11-30</td>
               <td class="ng-binding">2020-11-29T21:02:20.942</td>
               <td class="ng-binding">NORMAL-7-HUK5</td>
               <td class="ng-binding">PRODUCTION</td>
               <td><a href="/#/run-details/f0f7c33e/159a11e8-723a-4394-8fdd-588765fb8a66" class="ng-binding">f0f7c33e</a></td>
               <td class="ng-binding">159a11e8-723a-4394-8fdd-588765fb8a66</td>
          </tr>
     </tbody>
     <!-- end ngRepeat: entry in popCtrl.fabRunListFiltered = (fabRunList | startFrom:popCtrl.currentPage*popCtrl.rows_requests | limitTo : popCtrl.rows_requests) -->
</table>

Many thanks

Alright, easier indeed when I can see the HTML Structure of the Page/Table, especially as they didn't use a "completely Standard" Structure for this Table... :o
=> Then it will be...:

Code: Select all

TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R5 TYPE=TD ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_
... or:

Code: Select all

TAG POS=1 TYPE=TH ATTR=TXT:OutputId
TAG POS=R5 TYPE=TD ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_
... or:

Code: Select all

TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R1 TYPE=A ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_
All 3 Variants should work..., the 1st one is the most "Standard"..., and one of the Variants I had already posted in my 1st Reply, with "TH" instead of "TR"...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
GreatCornholio
Posts: 5
Joined: Sun Nov 29, 2020 5:20 pm

Re: Extract variable from output table to select hyperlink

Post by GreatCornholio » Tue Dec 01, 2020 7:34 pm

Bingo. The first code you provided works to bring back the value in Output ID. great progress

Working code to bring back Outpud ID value:

Code: Select all

Code: Select all

TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R5 TYPE=TD ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}__

My two follow up questions are:

1) The Prompt section of the code isnt completing the intended use case, here the code is pulling out the value when I'd ask the script to select the hyperlinked Output id value to progress to the next webpage. Ive had a go at two lines of code below but am unable to get it to work, am I barking up the right tree?

TAG POS=1 TYPE=BUTTON ATTR=TXT:<SP>_{{!EXTRACT}}_
&
PROMPT {{!EXTRACT}}

Full section of code:

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:NORMAL-2056132-XUKL
TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R5 TYPE=TD ATTR=TXT:* EXTRACT=TXT
wait seconds = 2
PROMPT {{!EXTRACT}}  --- attempting here to ask the script to select the hyperlinked output id value
wait seconds = 1
TAG POS=1 TYPE=A ATTR=TXT:CSVs
TAG POS=1 TYPE=LI ATTR=TXT:Eliminated<SP>Asin<SP>Information


2) How do I go one further to pull back the OutputID on say the second row of the output table? Or even better row where FcType-OGL (column 3) = "NORMAL-7-HUK5" / or specific text?

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:NORMAL-2056132-XUKL --- wanting it to look for this in column or looking to select X row outpudId
TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R5 TYPE=TD ATTR=TXT:* EXTRACT=TXT
wait seconds = 2
PROMPT {{!EXTRACT}}  --- attempting here to ask the script to select the hyperlinked output id value
wait seconds = 1
TAG POS=1 TYPE=A ATTR=TXT:CSVs
TAG POS=1 TYPE=LI ATTR=TXT:Eliminated<SP>Asin<SP>Information

If it helps, table HTML with 2 rows:

<table id="runs-table" class="table"> <thead class="thead-inverse"> <tr> <th>Run For Date</th> <th>Time of Run</th> <th>FcType IOGL</th> <th>Type</th> <th>OutputId</th> <th>RunId</th> </tr> </thead> <!-- ngRepeat: entry in popCtrl.fabRunListFiltered = (fabRunList | startFrom:popCtrl.currentPage*popCtrl.rows_requests | limitTo : popCtrl.rows_requests) --><tbody ng-repeat="entry in popCtrl.fabRunListFiltered = (fabRunList | startFrom:popCtrl.currentPage*popCtrl.rows_requests | limitTo : popCtrl.rows_requests)" class="ng-scope"> <tr> <td class="ng-binding">2020-11-30</td> <td class="ng-binding">2020-11-29T21:02:20.942</td> <td class="ng-binding">NORMAL-7-HUK5</td> <td class="ng-binding">PRODUCTION</td> <td><a href="/#/run-details/f0f7c33e/159a11e8-723a-4394-8fdd-588765fb8a66" class="ng-binding">f0f7c33e</a></td> <td class="ng-binding">159a11e8-723a-4394-8fdd-588765fb8a66</td> </tr></tbody><!-- end ngRepeat: entry in popCtrl.fabRunListFiltered = (fabRunList | startFrom:popCtrl.currentPage*popCtrl.rows_requests | limitTo : popCtrl.rows_requests) --> </table>


Thank you for your continued support.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extract variable from output table to select hyperlink

Post by chivracq » Tue Dec 01, 2020 8:51 pm

GreatCornholio wrote:
Tue Dec 01, 2020 7:34 pm
Bingo. The first code you provided works to bring back the value in Output ID. great progress

Working code to bring back Outpud ID value:

Code: Select all

Code: Select all

TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R5 TYPE=TD ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}__

My two follow up questions are:

1) The Prompt section of the code isnt completing the intended use case, here the code is pulling out the value when I'd ask the script to select the hyperlinked Output id value to progress to the next webpage. Ive had a go at two lines of code below but am unable to get it to work, am I barking up the right tree?

Code: Select all

TAG POS=1 TYPE=BUTTON ATTR=TXT:<SP>_{{!EXTRACT}}_
&

Code: Select all

PROMPT {{!EXTRACT}}
Full section of code:

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:NORMAL-2056132-XUKL
TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R5 TYPE=TD ATTR=TXT:* EXTRACT=TXT
wait seconds = 2
PROMPT {{!EXTRACT}}  --- attempting here to ask the script to select the hyperlinked output id value
wait seconds = 1
TAG POS=1 TYPE=A ATTR=TXT:CSVs
TAG POS=1 TYPE=LI ATTR=TXT:Eliminated<SP>Asin<SP>Information


2) How do I go one further to pull back the OutputID on say the second row of the output table? Or even better row where FcType-OGL (column 3) = "NORMAL-7-HUK5" / or specific text?

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:NORMAL-2056132-XUKL --- wanting it to look for this in column or looking to select X row outpudId
TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R5 TYPE=TD ATTR=TXT:* EXTRACT=TXT
wait seconds = 2
PROMPT {{!EXTRACT}}  --- attempting here to ask the script to select the hyperlinked output id value
wait seconds = 1
TAG POS=1 TYPE=A ATTR=TXT:CSVs
TAG POS=1 TYPE=LI ATTR=TXT:Eliminated<SP>Asin<SP>Information

If it helps, table HTML with 2 rows:

<table id="runs-table" class="table"> <thead class="thead-inverse"> <tr> <th>Run For Date</th> <th>Time of Run</th> <th>FcType IOGL</th> <th>Type</th> <th>OutputId</th> <th>RunId</th> </tr> </thead> <!-- ngRepeat: entry in popCtrl.fabRunListFiltered = (fabRunList | startFrom:popCtrl.currentPage*popCtrl.rows_requests | limitTo : popCtrl.rows_requests) --><tbody ng-repeat="entry in popCtrl.fabRunListFiltered = (fabRunList | startFrom:popCtrl.currentPage*popCtrl.rows_requests | limitTo : popCtrl.rows_requests)" class="ng-scope"> <tr> <td class="ng-binding">2020-11-30</td> <td class="ng-binding">2020-11-29T21:02:20.942</td> <td class="ng-binding">NORMAL-7-HUK5</td> <td class="ng-binding">PRODUCTION</td> <td><a href="/#/run-details/f0f7c33e/159a11e8-723a-4394-8fdd-588765fb8a66" class="ng-binding">f0f7c33e</a></td> <td class="ng-binding">159a11e8-723a-4394-8fdd-588765fb8a66</td> </tr></tbody><!-- end ngRepeat: entry in popCtrl.fabRunListFiltered = (fabRunList | startFrom:popCtrl.currentPage*popCtrl.rows_requests | limitTo : popCtrl.rows_requests) --> </table>


Thank you for your continued support.

Alright, good to hear that the 'EXTRACT' using 'Relative Positioning' is "finally" working... :D

Well, about:

Code: Select all

PROMPT EXTRACT:<SP>_{{!EXTRACT}}_
... it is simply meant to debug your Script by following and displaying your Vars, here "only" the Built-in '!EXTRACT' Var...

But if you want to debug and follow several Cells like you mention if you have several Rows of Data in the Table, every Cell from the same Col can be accessed and extracted with 'POS=R6' as your Table has 6 Cols, => for example...:

Code: Select all

'Extract 'OutputId' from 1st Row:
TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
SET !EXTRACT NULL
TAG POS=R5 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SET OutputId_1 {{!EXTRACT}}
'>
'Extract 'OutputId' from 2nd Row:
SET !EXTRACT NULL
TAG POS=R6 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SET OutputId_2 {{!EXTRACT}}
'>
'Extract 'OutputId' from 3rd Row:
TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
SET !EXTRACT NULL
TAG POS=R6 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SET OutputId_3 {{!EXTRACT}}
'>
'Display all 3 Vals:
PROMPT OutputId_1:<SP>_{{OutputId_1}}_<BR>OutputId_2:<SP>_{{OutputId_2}}_<BR>OutputId_3:<SP>_{{OutputId_3}}_
And you can the reuse the 3 Vals/Vars wherever you want in your Script..., like for example:

Code: Select all

TAG POS=1 TYPE=A ATTR=TXT:{{OutputId_1}}
And, yep of course, you can use your "NORMAL-7-HUK5" from Col_3 to extract the corresponding 'OutPutId', like in:

Code: Select all

SET FcType_IOGL "NORMAL-7-HUK5"
TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R1 TYPE=TD ATTR=TXT:{{FcType_IOGL}}
SET !EXTRACT NULL
TAG POS=R2 TYPE=TD ATTR=TXT:* EXTRACT=TXT
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_
... => With 'POS=R2' for the 'OutPutId' which is in Col_5 while the 'FcType_IOGL' is in Col_3... :idea:

Reply typed and finished "a bit quickly" because a Friend just came over... and it's my BDay in 2 hours, ah-ah...! :P

EDIT:
4 hours later, Friend is gone (home), Post checked on Typos and "Mistakes", I didn't find any... He came a bit "too early", I wanted to post "more Info" in my Reply, OK, didn't have the time, but my Reply is still "correct"... :wink:

Oh yeah, and hum, about your "table HTML with 2 rows", I only see 1 Row (of Data), same like your previous Post..., but I think I explained/demonstrated the "Principle" on how to extract with several Rows of Data... 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
GreatCornholio
Posts: 5
Joined: Sun Nov 29, 2020 5:20 pm

Re: Extract variable from output table to select hyperlink

Post by GreatCornholio » Sun Dec 06, 2020 5:59 pm

Firstly I hope you had a great Birthday!

Thanks for the builds on the script here, I was continuing to encounter issues whereby having identified the value to 'select' or 'click' the script wasn't going ahead and clicking and loading next webpage. Apologies if the solution was in your last answer but I had couldnt get that to work.

The workaround is take the output of the variables found and hardcoding them in to a GOTO URL command. Thankfully the attributes i need are on the hyperlinked URL which then loads up the page I needed to get to. Working script below

Code: Select all

SET !EXTRACT NULL
TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R5 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SET OutputId_1 {{!EXTRACT}}
'>
'Extract 'OutputId' from 2nd Row:
SET !EXTRACT NULL
TAG POS=1 TYPE=TR ATTR=TXT:*Type*OutputId*RunId*
TAG POS=R6 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SET OutputId_2 {{!EXTRACT}}

URL GOTO= https://website/{{OutputId_1}}/{{OutputId_2}}
Thanks again for your support here, unless there is an obvious answer to asking the script to select a button/hyperlinked text after identifying what it is to select I would consider this problem resolved
Post Reply