Last active
July 7, 2022 09:35
-
-
Save abdeljalil09/39f78cb163d9a47e244b2abce300f5b6 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
/* eslint-disable @typescript-eslint/no-var-requires */ | |
const puppeteer = require('puppeteer-extra'); | |
const StealthPlugin = require('puppeteer-extra-plugin-stealth'); | |
const sealth = StealthPlugin(); | |
const link = 'https://sso.godaddy.com/'; | |
(async () => { | |
puppeteer.use(sealth); | |
const browser = await puppeteer.launch({ | |
headless: false, | |
executablePath: | |
'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', | |
defaultViewport: null, | |
ignoreHTTPSErrors: true, | |
args: [ | |
'--start-maximized', | |
'--window-size=1920,1080', | |
'--disable-dev-shm-usage', | |
'--no-sandbox', | |
'--disable-setuid-sandbox', | |
], | |
}); | |
//close default blank page | |
const mypage = await browser.newPage(); | |
const [page] = await browser.pages(); | |
await page.close(); | |
await mypage.goto(link, { waitUntil: ['networkidle2', 'load'] }); | |
await mypage.$eval( | |
"input[type='text']", | |
(e) => (e.style = 'filter: blur(8px);'), | |
); | |
await mypage.$eval( | |
"input[type='password']", | |
(e) => (e.style = 'filter: blur(8px);'), | |
); | |
await mypage.type("input[type='text']", 'email'); | |
await mypage.waitForTimeout(1000); | |
await mypage.type("input[type='password']", 'pass'); | |
await mypage.waitForTimeout(1000); | |
await mypage.click('#submitBtn'); | |
})().catch((err) => console.log(err)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment