How to repeat sourceExtract using POS?

Sorry, I have so many questions!

I have a macro that goes to a url, and then:

  1. sourceSearch for target “brands”, Value “brandsCount”
  2. The next step is a sourceExtract for target “brands” with value !csvLine
  3. The next step is csvSave target “brandmentions”

sourceSearch is telling me there are 63 occurrences within the source code, but sourceExtract is only saving the first line in which it is found.

How to I tell it to repeat for each occurrence?

I have amended the title of this a bit as I think I have figured out how to make my macro repeat the correct number of times, but it is adding each result to the end of the same line.

How can I get it to add each result to a new line on the csv file?

Okay, I’ve figured that one out, now for the next step! :smile:

  1. I have a macro set up to sourceSearch for a word, and store the count in the variable “count”
  2. I have managed to use a loopcounter, incrementing by +1 each run, and stopping when it greater than the number in the count variable.

The problem is, for each loop, it only returns the first result. So if I get 63 instances of “brand” in the source code, it returns the first instance 63 times.

I have tried using:
sourceExtract *brand*@POS=${!LOOP} in the hope it will increment each instance along with the loopcounter, but that returns #nomatch 63 times :confused:

Any advice?

Okay, I got it, I think. I used @${LoopCounter} instead of LOOP