Skip to content

Instantly share code, notes, and snippets.

@mateutek
Created March 9, 2022 11:49
Show Gist options
  • Save mateutek/654530f001125dd6472483d622d6d60f to your computer and use it in GitHub Desktop.
Save mateutek/654530f001125dd6472483d622d6d60f to your computer and use it in GitHub Desktop.
const puppeteer = require('puppeteer');
function timeout(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
(async () => {
try {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.setJavaScriptEnabled(true);
await page.goto('https://passport.beqom.com/', {waitUntil: 'domcontentloaded'});
const loginInput = await page.$('#InitialPassportName')
await loginInput.type('email', { delay: 200 });
await loginInput.press('Enter');
await page.waitForSelector('#wizard-p-1', {visible: true});
await page.waitForSelector('#wizard-p-0', {hidden: true});
const passwordInput = await page.$('#Password')
await passwordInput.type('password', { delay: 200 });
await passwordInput.press('Enter')
}
catch (e) {
console.log(e);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment