Need help making a simple counting script

Find a consultant or advertise your services here

Moderators: Community Moderators, iMacros Moderators

Need help making a simple counting script

by Matt Whitt on Thu Mar 20, 2014 10:45 am

Basically I need to run an imacro script to see how many times a word appears on a page, Ive seen another post on this and I tried the script and I get errors on line 10.

Basically I dont know how to set the VAR2 to make it count the words. i guess.

SET !EXTRACT_TEST_POPUP NO
URL GOTO=(the URL i need)
SET !VAR1 (word I need found)
TAG POS=1 TYPE=HTML ATTR=* EXTRACT=TXT

this is the part i dont understand.

' Use EVAL with a regular expression to count the number of occurrences of the target word
SET !VAR2 EVAL("var pageText = \"{{!EXTRACT}}\"; var matches = pageText.match(/{{!VAR1}}/gi); matches.length - 1;")
PROMPT "\"{{!VAR1}}\" occurs {{!VAR2}} time(s)"

thats the script i found on the other page..

can someone take out whats not needed, and help me fill in the blanks.

Please and thanks.
Matt Whitt
 
Posts: 1
Joined: Thu Mar 20, 2014 10:38 am

Re: Need help making a simple counting script

by chivracq on Fri Mar 21, 2014 3:03 am

This is not the correct Sub-Forum if you are looking for a "free" Answer...

(And you'll need to mention your Configuration with Versions (iMacros + Browser + OS).)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5843
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Need help making a simple counting script

by billhood on Thu Apr 02, 2015 3:32 am

post on this and I tried the script and I get errors on line 10.
Nawaz
billhood
 
Posts: 1
Joined: Thu Apr 02, 2015 3:28 am


Return to iMacros Consultants

Who is online

Users browsing this forum: No registered users and 2 guests

Website Monitoring