Here is my solution:
-
Loop over the table, extract the text (in your case: number) of each row, until the right row is found. Then “number of loops” = “row number”.
-
Then use POS to click the x-th “Edit” button.
<x>
is the row number that we got from step 1.
Test macro for the 7-zip page. It finds the right download link (1st column), given the text in the 4th column. The only issue I see is that it might be a bit slow if your table has 100s of rows?
{
"CreationDate": "2018-11-22",
"Commands": [
{
"Command": "open",
"Target": "https://www.7-zip.org/download.html",
"Value": ""
},
{
"Command": "store",
"Target": "7-Zip Source code",
"Value": "wordtosearchfor"
},
{
"Command": "store",
"Target": "1",
"Value": "myrow"
},
{
"Command": "store",
"Target": "fast",
"Value": "!replayspeed"
},
{
"Command": "label",
"Target": "GetNextRow",
"Value": ""
},
{
"Command": "storeEval",
"Target": "${myrow} + 1",
"Value": "myrow"
},
{
"Command": "storeText",
"Target": "/html/body/table/tbody/tr/td[2]/table[1]/tbody/tr[${myrow}]/td[4]",
"Value": "t1"
},
{
"Command": "echo",
"Target": "t1=${t1}",
"Value": ""
},
{
"Command": "gotoIf",
"Target": "\"${t1}\" != \"${wordtosearchfor}\"",
"Value": "GetNextRow"
},
{
"Command": "storeEval",
"Target": "${myrow} - 1",
"Value": "mylink"
},
{
"Command": "echo",
"Target": "Download link is in row ${myrow}, ${mylink}th link",
"Value": ""
},
{
"Command": "click",
"Target": "link=Download@POS=${mylink}",
"Value": ""
}
]
}