How to use chrome profile in puppeteer

Viewed 16170

I am unable to use specific profile in Puppeteer. It always open the chrome as a new user.

For example: I have 3 profiles for my chrome. Following is the code I am using to open chrome in specific profile:

const browser = await puppeteer.launch({
    headless: false,
    executablePath: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
    // args: ['--profile-directory="Profile 1"'],
    userDataDir:"C:\\Users\\USER_NAME\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1"
  });

But it always open the chrome as "Current user" profile.

1 Answers
Related