cc-tracking/tasks/DIN-136 Batch2/it.js.md
2019-05-29 16:04:31 +01:00

610 B

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);