pablomuro

Untitled

Aug 5th, 2021 (edited)
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       let current = await page.$eval('body',(el) => el.querySelector('td[data-handler="selectDay"]'));
  2.  
  3.       while (current) {
  4.         console.log(current)
  5.         console.log(current.toString())
  6.         if (current && current.toString().includes('a.ui-state-default')) {
  7.           // @ts-ignore
  8.           // await page.evaluate((current: HTMLElement) => current.click(), current);
  9.           await current.click()
  10.           await page.waitForTimeout(2000)
  11.           const atividade = await page.$('#cmbActividades');
  12.           // @ts-ignore
  13.           await atividade.select('840616');
  14.  
  15.           const horas = await page.$('#HorasCapturadas');
  16.           // @ts-ignore
  17.           await horas.select('8')
  18.  
  19.           await page.click('#btnOk')
  20.           await page.waitForTimeout(5000)
  21.           console.log('CLICOUUUUUUUUUUUUUUUUUUU')
  22.         }
  23.         current = (current) ? current.nextElementSibling as HTMLElement : null
  24.       };
Add Comment
Please, Sign In to add comment