Skip to content

Instantly share code, notes, and snippets.

@lazyCoder10
Last active August 16, 2022 20:23
Show Gist options
  • Save lazyCoder10/5a674a12b0408af9dd6a7665bde28966 to your computer and use it in GitHub Desktop.
Save lazyCoder10/5a674a12b0408af9dd6a7665bde28966 to your computer and use it in GitHub Desktop.
const CronJob = require('cron').CronJob;
const $ = require('cheerio');
const puppeteer = require("puppeteer-extra");
const pluginStealth = require("puppeteer-extra-plugin-stealth");
const {hcaptcha} = require("puppeteer-hcaptcha");
const { hcaptchaToken } = require('puppeteer-hcaptcha');
puppeteer.use(pluginStealth());
(async() => {
const browser = await puppeteer.launch({
ignoreHTTPSErrors: true,
headless: false,
slowMo: 8,
defaultViewport: null,
args: [
"--window-size=600,1000",
"--window-position=000,000",
"--disable-dev-shm-usage",
"--no-sandbox",
'--user-data-dir="/tmp/chrome"',
"--disable-web-security",
"--disable-features=site-per-process",
],
});
const [page] = await browser.pages();
await page.goto('https://cgifederal.secure.force.com');
await page.setDefaultNavigationTimeout(0);
await page.waitFor(20000);
const iframeSelector = 'iframe';
const frameHandle = await page.$(iframeSelector);
const src = await page.evaluate(el => el.src, frameHandle);
console.log(src);
await hcaptcha(page);
/*
LOGIN_DETAILS_BLOCK
*/
await page.click('[id*=loginButton]');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment