cc-tracking/tasks/DIN-136 Batch2/it.js.md

20 lines
610 B
Markdown
Raw Normal View History

2019-05-29 15:04:31 +00:00
290
// wait for loading shroud to go away
await this.page.waitForSelector('div.loading', { 'visible':false, 'timeout':25000 });
let btnSuccess = false;
let breakCount = 0;
do {
await this.page.waitForSelector('button.btn.btn-success', { 'visible':true, 'timeout':45000 }).then(async (elm) => {
await elm.click({ 'delay':Scraper.notARobot() });
}).catch(() => {
btnSuccess = true;
});
await this._randomWait(this.page, 1, 1, 'preparePSSearch btnSuccess');
breakCount++;
}
while(!btnSuccess && breakCount < 5);