Created
October 27, 2022 00:00
-
-
Save luisangelorjr/85a13cc44b920a931a62a1ca882cb6e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import puppeteer from 'puppeteer'; | |
const headlessMode = true; | |
const urlWebPontoLoginEmpresa = "https://empresa.com.br/"; | |
const urlWebPontoPunchEmpressa = "https://empresa.com.br/ponto/marcarPonto.asp"; | |
const codEmpresa = "999"; | |
const login = "666"; | |
const password = "QueDeliciaAutomatizar"; | |
(async () => { | |
const browser = await puppeteer.launch(({ headless: headlessMode })); | |
const page = await browser.newPage(); | |
await page.goto(urlWebPontoLoginEmpresa); | |
await page.type('#CodEmpresa', codEmpresa); | |
await page.type('#inputUsuario', login); | |
await page.type('#inputSenha', password); | |
await page.click('#botaoSubmit'); | |
await page.goto(urlWebPontoPunchEmpressa); | |
await page.screenshot({ path: `screenshots/pptr-empresa-ponto/${new Date().toISOString()}.jpg`, type: 'jpeg', quality: 90 }); | |
await page.click('.baterPontoBtn'); | |
console.log("THE END"); | |
await browser.close(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment