Having played around some more. The script fails if dv.pages()
returns one or more pages where the regex does not match anything and so content.match
’s
“return value is not iterable” (as the error says). My very limited js is probably not up to working out how to fix the for loop so this doesn’t raise an error.