The nightmare is working, of course I'm testing this tool but nway, the mainly problem is why my function isnt on a infinite loop? Since i didnt make a condition to page. May I'm doing this wrong?

The case that I wanted was: whenever page loaded, I get the tittle with page then call the function again to next page till the last page.

I tried without success the setTimeout too.

My console log just print 1 then finish.

The code snippet is here:-

```
var pagn = 1;
function ab(page){
    nightmare.goto(url_base+"&page="+page)
             .evaluate(() => {
                return document.title;
            })
            .end()
            .then((title) => {
                console.log(title + ":" + page);
                ab(++pagn);
                //setTimeout("page(" + page + ")", 5000);
            }).catch(()=>{console.log("Error");});
}
ab(pagn);

```