Skip to content Skip to sidebar Skip to footer

Exclude Urls When Running A Script

I am using Firefox, iMacros and js. I have a URLs.txt-file with a list of URLs. In Firefox I have a webpage open in Tab 1. This website contains many URLs. Some of which are in my

Solution 1:

I can give you a clue. Let's make your txt-file with the list of URLs something like this:

"http://www.example1.com
http://www.example2.com
http://www.example3.com"

Pay attention to the fact that there are only two double quotes: at the beginning and at the end of this list. So your script may look like:

iimPlayCode (
    "SET !DATASOURCE URLs.txt" + "\n" +
    "SET !EXTRACT {{!COL1}}"
);
var excLinks = iimGetExtract().split(/\s+/);

var incLinks = [];
for (i = 1; i <= window.document.querySelectorAll("HTML>BODY>UL:nth-of-type(2)>LI").length; i++)
    if (excLinks.indexOf(window.document.querySelector("HTML>BODY>UL:nth-of-type(2)>LI:nth-of-type(" + i + ")>A").href) == -1)
        incLinks.push(i);

for (i = 0; i < Math.min(incLinks.length, 10); i++)
    iimPlayCode('EVENT TYPE=CLICK SELECTOR="HTML>BODY>UL:nth-of-type(2)>LI:nth-of-type(' + incLinks[i] + ')>A" BUTTON=0 MODIFIERS="ctrl"');

I leave testing this code on the target web site for you.

Post a Comment for "Exclude Urls When Running A Script"