Open links in emails based on link address

Hello,

I’ve been struggling to find a way to open the links in a group of e-mails I get since they don’t have named IDs and gmail jumbles things up so there’s no consistent pattern between them aside from the fact that all of the addresses the links lead to start with “https://egift.activationspot.com/egift” and then branch out from there. As an example, here’s what Kantu recorded my clicks to 3 of these links (in 3 separate e-mails that gmail threaded) as:

//[@id=":97s"]/div/div[2]/div/table/tbody/tr/td[2]/table/tbody/tr[2]/td/table/tbody/tr[2]/td/a/img
//
[@id=":98e"]/div/div[2]/div/table/tbody/tr/td[2]/table/tbody/tr[2]/td/table/tbody/tr[2]/td/a/img
//*[@id=":990"]/div/div[2]/div/table/tbody/tr/td[2]/table/tbody/tr[2]/td/table/tbody/tr[2]/td/a/img

or alternatively:

css=#:97s > div > div.im > div > table > tbody > tr > td:nth-child(2) > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > a > img
css=#:98e > div > div.im > div > table > tbody > tr > td:nth-child(2) > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > a > img
css=#:990 > div > div.im > div > table > tbody > tr > td:nth-child(2) > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > a > img

On iMacros, I can open these links in a loop using the following lines:

TAG POS={{!LOOP}} TYPE=A ATTR=HREF:https://egift.activationspot.com/egift
TAB T=1

Is there a way to do the same in Kantu (preferably something that doesn’t include a visual search or xmodules since they slow things down a lot)?

Thanks in advance and sorry if there’s a very simple answer I’ve overlooked, I’m still learning the ropes.

Kantu also has a POS parameter so this should work:

click | link=https://egift.activationspot.com/egift*@pos=${!LOOP}

Note that there is an asterix * at the end of the link, since it is only a partial link.

Test macro:

{
  "Name": "Untitled",
  "CreationDate": "2019-2-1",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://a9t9.com/kantu/demo/storeeval",
      "Value": ""
    },
    {
      "Command": "clickAndWait",
      "Target": "link=This li*@POS=2",
      "Value": ""
    }
  ]
}

Thank you ulrich, while that didn’t fix this particular issue (and I think it’s my fault for not describing the issue adequately) it did help with another problem I’ve been trying to solve.

I did a little experimentation and I think I couldn’t get it to work because the links are not in the body of the e-mail but rather embedded in an image (or button) in the e-mail that I have to click in order to navigate to the address I want to go to - your suggestion does work when the links are in the body of the e-mail. Also as a clarification, the recording results I shared in the original post are what Kantu recorded each time I clicked on one of those images, and the iMacros script is able to open the links in these images with those two lines I shared.

I’d be happy to forward you a few of these e-mails if that would help you understand the problem better.