-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Demo not working #22
Comments
@DanielMedina114 you mind sending me a few things so I can look into it? I'll need to see all your code and either a photo or a description of your files hierarchy so I can narrow down the issue. |
same here demo not working,
Env:
code: // Require puppeteer extra, puppeteer stealth, google vision
const puppeteer = require("puppeteer-extra");
const pluginStealth = require("puppeteer-extra-plugin-stealth");
// Require our hcaptcha method
const { hcaptcha } = require("puppeteer-hcaptcha");
// Tell puppeteer to use puppeteer stealth
puppeteer.use(pluginStealth());
(async () => {
// Instantiate a new browser object
// Ignore errors associated to https
// Can be headless but for example sake we want to show the browser
// Set your desired arguments for your puppeteer browser
const browser = await puppeteer.launch({
ignoreHTTPSErrors: true,
headless: false,
args: [
`--window-size=600,1000`,
"--window-position=000,000",
"--disable-dev-shm-usage",
"--no-sandbox",
'--user-data-dir="/tmp/chromium"',
"--disable-web-security",
"--disable-features=site-per-process",
],
});
// Get browser pages
const [page] = await browser.pages();
// Send page to your url
await page.goto("http://democaptcha.com/demo-form-eng/hcaptcha.html");
// Remove the page's default timeout function
await page.setDefaultNavigationTimeout(0);
// Call hcaptcha method passing in our page
await hcaptcha(page);
// Your page is ready to submit. Captcha solving should be the last function on your page so we don't have to worry about the response token expiring.
/**
* Example:
* await page.click("loginDiv > loginBtn");
*/
})(); File hierarchy :
|
@fachryansyah what happens if you change this line const [page] = await browser.pages();
// to
const page = await browser.newPage(); |
Same issue with the code from your comment. "puppeteer": "^13.0.0",
"puppeteer-extra": "^3.2.3",
"puppeteer-extra-plugin-stealth": "^2.9.0",
"puppeteer-hcaptcha": "^4.1.1", |
Maybe this helps you - this is the example site that renders the hCaptcha. It's actually not in an iFrame |
Another guaranteed captcha is just visiting: https://www.mediamarkt.de/de/product/_sony-playstationr5-fifa-22-dualsense-controller-midnight-black-2778294.html |
@timbru31 Just checked the source for the page you sent and it is being loaded in an iframe as well. It looks like I need to update my code to look for a new source of the file though so I can make those changes now. Thanks for the heads up. |
Just tested with the new changes using the website you provided and it looks to be working now. It does take slightly longer since it has to wait for the hcaptcha element to actually load (see results below):
I will push the fix shortly! |
Thanks for the quick fix, however still hitting We might be hitting puppeteer/puppeteer#7814, too? |
@timbru31 did you try this suggestion in reference to the about:blank issue? I can test the code on Mac in a bit if you tried that and the same issue still presents itself. |
Yes, that did not do the trick. I've patched the puppeteer code (line 370 in DomWorld.js to This does solve the issue, but I assume the captcha solving itself is not working. (I've just done a form submit on the page to have a reload that should in theory redirect me) Comparing what's submitted when solving the captcha manually vs with the plugin I've noticed the following differences:
Currently digging deeper into the CF captcha logic (e.g., reading here: https://github.com/scaredos/cfresearch#captcha-challenge) |
@timbru31 this project only really solves for the hcaptcha response token value. It's honestly meant for simple integration and unfortunately because of this it seems like for anyone that wishes to do anything more complex most of the work is on them. I could definitely be interested in looking into expanding on this project to make it a full fledged hcaptcha solver but I don't currently have the time to dive that deep into trying to reverse hcaptcha and all the different types of possible versions surrounding it. |
I believe I have realized the issue many people were having here. I modified the ghost-cursor package to include a timestamp (which is required for requests) but didn't process the fact that my changes would only work for me. I have created a pull request for the ghost-cursor repo with these changes that will fix these issues. If my request doesn't get accepted I will manually make the changes to this package. |
I have downloaded the latest version v4.0.1, however I am unable to run successfully the solve.js from the demo:
I added the URL https://2captcha.com/demo/hcaptcha/ on line 34 of solve.js
I am not particularly familiar with JavaScript, maybe I am missing something.
The text was updated successfully, but these errors were encountered: