puppeteer-extra icon indicating copy to clipboard operation
puppeteer-extra copied to clipboard

Usage of puppeteer-core with puppeteer-extra

Open photorealisticbeaver opened this issue 1 year ago • 11 comments

Starting on puppeteer 19, PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true seems to be ignored, so it would be quite handy to be able to use puppeteer-core with puppeteer-extra

photorealisticbeaver avatar Apr 26 '23 15:04 photorealisticbeaver

puppeteer-core is supported https://github.com/berstend/puppeteer-extra/blob/39248f1f5deeb21b1e7eb6ae07b8ef73f1231ab9/packages/puppeteer-extra/src/index.ts#L534-L538

ushuz avatar Apr 28 '23 22:04 ushuz

@ushuz sorry, but still getting this on a clean build, under node_modules/puppeteer-extra/dist/index.d.ts

currently with:

  • puppeteer-core 19.11.1
  • puppeteer-extra 3.3.6
  • puppeteer-extra-plugin-stealth 2.11.2

image

PS - also getting this from node_modules/puppeteer-extra-plugin/dist/(puppeteer.d.ts image

photorealisticbeaver avatar May 01 '23 23:05 photorealisticbeaver

@photorealisticbeaver were you able to use puppeteer-core with puppeteer-extra?

massenandev avatar Jun 26 '23 15:06 massenandev

@massenandev not really, no

photorealisticbeaver avatar Jun 26 '23 15:06 photorealisticbeaver

Any updates? How would you use puppeteer-extra when you don't want to install the browsers with puppeteer?

AdrKacz avatar Sep 25 '23 13:09 AdrKacz

Any updates? Trying to use puppeteer-extra with @sparticuz/chromium. So I need only puppeteer-core.

Rusty-b0lt avatar Oct 05 '23 12:10 Rusty-b0lt

@AdrKacz @Rusty-b0lt I wasn't able to put it to work, and haven't tried again. I stayed with the latest v18, where you could use PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

@ushuz anything that I was missing, for it not to work with puppeteer-core?

photorealisticbeaver avatar Oct 06 '23 11:10 photorealisticbeaver

@Rusty-b0lt @AdrKacz did you find any solution ? I'm trying to use puppeteer-extra with @sparticuz/chromium-min and puppeteer-core

BaptisteDri avatar Oct 10 '23 20:10 BaptisteDri

Seems puppeteer is installed by default by puppeteer-extra. It would be helpful to be able to pass in an instance of puppeteer and not have this package install it by default.

npm ls puppeteer   
[email protected] PATH_TO_PROJECT
└─┬ [email protected]
  └── [email protected]

mbrevda avatar Oct 31 '23 10:10 mbrevda

@BaptisteDri no solutions found:( im also trying to use with @sparticuz/chromium in aws lambda, maybe i really should just downgrade to v18

Rusty-b0lt avatar Nov 14 '23 19:11 Rusty-b0lt

@Rusty-b0lt

I'm able to run @sparticuz/chromium with puppeteer-extra: "^3.3.6" inside of aws-lambda by setting this environment variable: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 and passing the following configuration into puppeteer:

import puppeteer from "puppeteer-extra"
import Chromium from "@sparticuz/chromium"

export const PuppeteerConfig = async () => {
    return await puppeteer.launch({
      executablePath: await Chromium.executablePath(),
      headless: true,
      ignoreHTTPSErrors: false,
      args: [...Chromium.args, "--incognito", "--no-sandbox"]
    })
}

Edit: The issue I've found with this method is that the plugins which are enabled by puppeteer-extra expect puppeteer's default Chrome version to be installed to it's default location. As far as I can tell, none of these plugins have any such configuration options available which allow us to point the plugin to our own version of chromium.

ford-jones avatar Nov 16 '23 22:11 ford-jones