Comments (8)
Hi, Puppeteer stops working when an error is received (even when closing the browser) but chromium does not. This causes the browser to hang as you mentioned. I am working on this bug and will fix it.
from puppeteer-real-browser.
Please add your code. If you get an error, the program stops but chrome does not. It may be caused by this.
from puppeteer-real-browser.
The whole logic is in try catch and finally block, and in finally block I have await browser.close().
I will paste the code example later but FYI the same code was working with puppeteer and puppeteer stealth previously. I did not get into this situation of having multiple chrome processes hanging
from puppeteer-real-browser.
Just run these two scripts together. Only run the second one, first one needs to be in the same path.
////FIRST SCRIPT
import { connect } from 'puppeteer-real-browser'
const main = async () => {
const {browser, page} = await connect({
headless: 'auto',
args: [],
customConfig: {},
skipTarget: [],
fingerprint: false,
turnstile: false,
connectOption: {},
tf: true,
})
await page.goto('https://antoinevastel.com/bots/datadome');
await page.evaluate(() => {
return new Promise(resolve => {
setTimeout(resolve, 20000);
});
});
await browser.close();
process.exit(0);
}
main();
//SECOND SCRIPT
import { fork } from 'child_process';
const maxForks = 5; // Maximum number of forks allowed
let runningForks = 0; // Initialize the number of running forks
const startFork = () => {
const child = fork('./${NAME_OF_FIRST_SCRIPT}'); // Fork the main script
// Event handler for when the forked process exits
child.on('exit', () => {
runningForks--; // Decrement the count of running forks
if (runningForks < maxForks) {
startFork(); // Start a new fork if the count is less than the maximum
}
});
runningForks++; // Increment the count of running forks
}
// Start initial forks
for (let i = 0; i < maxForks; i++) {
startFork();
}
from puppeteer-real-browser.
@zfcsoftware is there any way I could help you with this to speed it up? This is the only thing that blocks me in using/testing this in my case. Thanks
from puppeteer-real-browser.
@zfcsoftware is there any way I could help you with this to speed it up? This is the only thing that blocks me in using/testing this in my case. Thanks
Hello,
puppeteer-real-browser/src/index.js
Line 166 in 2627cea
You can use the chrome.close() method.
from puppeteer-real-browser.
@zfcsoftware there is only chrome.kill() option. So you are telling me to get chrome instance back from connect method response and work with it as a temp solution?
from puppeteer-real-browser.
The chrome variable is already returned, yes you can use it that way. Normally this problem does not occur under normal conditions, but it may occur when an error is received, I need to examine it in detail.
https://github.com/zfcsoftware/cf-clearance-scraper/blob/main/module/browser.js
You can create a browser like this and try that too.
from puppeteer-real-browser.
Related Issues (20)
- new page can not create HOT 1
- Browser instance problem HOT 1
- Cannot Bypass Cloudflare Protection on StockX.com HOT 2
- Problem on turnstile and cf_clearance HOT 6
- Add Ads blocking feature HOT 1
- CloudFlare captcha reloading HOT 2
- ws affected by a DoS when handling a request with many HTTP headers? HOT 2
- unable to click turnstile HOT 4
- TimeoutError: Timed out after 30000 ms while waiting for the WS endpoint URL to appear in stdout! HOT 10
- Error Loading Extension HOT 10
- Error verison 1.2.31 in Ubuntu HOT 3
- Extension Function HOT 2
- Update Feature HOT 3
- Turnstile fails on Windows 11
- Is it possible to solve this captcha? HOT 2
- No longer able to pass turnstile with forced-open shadow root HOT 6
- Ads blocking in puppeteer-real-browser HOT 1
- Extracting tar content of undefined failed, the file appears to be corrupt
- Open modal/sidebar in dextools.io close unexpected
- Not working with custom fingerprint
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppeteer-real-browser.