Last active
August 16, 2022 20:23
-
-
Save lazyCoder10/5a674a12b0408af9dd6a7665bde28966 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
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