Reputation: 51
Suppose a HTML page contains following codes:
<div>
Please follow the link below
https://www.website.com/register/verify.php/0jdJcPDJPr31sXgRQEvw5OY97FgUfS.<br></div>
How can I tell iMacros to follow the URL which is present in the above DIV.
iMacro has to open the following URL in the current tab:
https://www.website.com/register/verify.php/0jdJcPDJPr31sXgRQEvw5OY97FgUfS
Please note that there is no A HREF in this, and it's just plain text. There is also a DOT at the end of the URL which must be discarded while opening the link.
I tried the following, without any success:
var confirmAcc;
confirmAcc = "CODE:";
confirmAcc += "TAG POS=1 TYPE=DIV ATTR=TXT:Please<SP>follow<SP>the<SP>link<SP>below*" + "\n";
iimPlay(confirmAcc);
This is just highlighting the DIV, and not following the URL in it.
Any help would be highly appreciated, as I have spent numerous hours trying to solve this problem.
Upvotes: 1
Views: 308
Reputation: 5299
Try this macro:
SET !EXTRACT_TEST_POPUP NO
TAG POS=1 TYPE=DIV ATTR=TXT:"Please follow the link below*" EXTRACT=TXT
SET link EVAL("'{{!EXTRACT}}'.match(/(http.*)\./)[1];")
URL GOTO={{link}}
Upvotes: 1