Closed ahernand53 closed 4 years ago
I'm doing exactly this but I create a loop with map and run the promise again for each website.
const scanCompetitor = url => {
return new Promise((resolve, reject) => {
nightmare
.goto(url)
.evaluate(() => document.querySelector('[itemprop="price"]').getAttribute('content'))
.end()
.then(foundPrice => resolve(foundPrice))
.catch(error => console.log('Search failed:', error));
});
}
const urls = [url1, url2, url2];
urls.map(async url => {
return scanCompetitor(url).then(async price => console.log(price));
});
@rafaelperozin Thank you, the only drawback is that I would update the page and it is not what I want, so I don't know how I would do it to stay on that page to make the reactive update
I've been looking for the following with nightmarejs if possible, but I haven't found anything.
So far what I have been able to achieve has been up to point 3. But not knowing how to pass after the otp code