Skip to content
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

Has anyone managed to use separate data for each browser? #532

Open
antizhyk opened this issue Dec 18, 2023 · 0 comments
Open

Has anyone managed to use separate data for each browser? #532

antizhyk opened this issue Dec 18, 2023 · 0 comments

Comments

@antizhyk
Copy link

Hey, everybody. I'm trying to make puppeter-cluster for each task create its own browser instance and it is very important that this browser instance is launched on certain data from the past session in a normal puppeter they are passed through userDataDir when using the launch method.

I found the perBrowserOptions parameter to which you can pass the configurations for the individual browser instance. But how do I, for example, specify which of the previously passed browser parameters in perBrowserOptions I want to use when launching cluster.queue() is unclear.

Here is my example code where I run a separate browser instance on puppeter
This is where I'm loading data from past account sessions for the browser.

     this.browser = await this.puppeteer.launch({
        userDataDir: `./tmp/${accountData?._id}`,
        headless: false,
        args: args,
      });

Now I'm trying to set up work for several accounts at the same time and each account needs its own browser and puppeter-cluster seems to be suitable for this, but I've encountered a problem, I can't configure session reuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant