Please help to run puppeteer with deno?
Here is code https://github.com/Beingminimal-gh/deno-puppeteer
GitHub
GitHub - Beingminimal-gh/deno-puppeteer
Contribute to Beingminimal-gh/deno-puppeteer development by creating an account on GitHub.
19 Replies
I'm sorry, but I wasn't able to find the answer to your question in the official Deno documentation. However, I can take a look at the code you've provided to see if there are any obvious syntax errors or mistakes.
After reviewing the code you linked to, here are a few general points to consider:
1. Ensure that you are using a Deno-compatible library for Puppeteer. The standard Puppeteer library is designed for Node.js, and Deno has different APIs and module resolution semantics.
2. Check that you have the necessary permissions enabled when running your Deno script, as Puppeteer will require permissions to access the network, file system, etc.
3. Verify that any dependencies are properly imported using URLs, as Deno does not use the
node_modules
system that Node.js does.
Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of the advice given. If you continue to have issues, you might want to look for Deno-specific resources or community examples of Puppeteer with Deno, as the Deno ecosystem is distinct from Node.js and may have different best practices or available libraries.Helpful Links:
Subprocesses: Collecting Output - Deno by Example
Importing & Exporting - Deno by Example
Deno Queues - Deno by Example
Hello World - Deno by Example
Subprocesses: Spawning - Deno by Example
Local development
Using Visual Studio Code
Contributing
Puppeteer: "BadResource: Bad resource ID" on Ubuntu - Deno
I couldn't pull the devcontainer image (unauthorized), but I did test using Ubuntu 24.04.
I can replicate the issue. The problem is that the downloaded version of Chrome requires at least one uninstalled shared library (libgobject-2.0 on my fresh Ubuntu install).
I was able to get your program test-1.ts working with the following two steps:
1. Install Chrome directly instead of pulling it via the deno script
2. Update the
puppeteer.launch
command to include executable path. (I also like to include the headless parameter, but that is optional.)
Then you can just run with deno run -A ./test-1.ts
(no unstable flag necessary).ok thanks a lot for support, i will try and let you know.
A possible alternative: https://jsr.io/@astral/astral
^Another vote for astral. It's the easiest way to get chromium running in Deno
does it support https://pptr.dev/webdriver-bidi?
Experimental WebDriver BiDi support | Puppeteer
WebDriver BiDi is a new cross-browser
No, astral uses the CDP protocol under the hood
I am unfamiliar with Astral, so I decided to try it out to see if it would work around the issues described in the original post. I used the screenshot example from the Astral page you linked on a fresh Ubuntu install. I get the same root error:
I still recommend installing Chrome by the steps provided above. If you do that, you'll want to set the
path
when launching a browser via Astral otherwise it will download Chrome again.@lino-levan ^
(I'm gonna guess the answer is "no")
webdriver bidi is really not ready yet
happy to release an experimental build with support if you need it
it looks like you're missing some system dependencies, were you trying to do this within docker or something?
I will create an issue to have a better error message (one with commands to run)
Can you please help now.
https://developer.chrome.com/blog/firefox-support-in-puppeteer-with-webdriver-bidi
Chrome for Developers
WebDriver BiDi production-ready in Firefox, Chrome and Puppeteer  |...
Puppeteer 23 introduces stable support for Firefox 129 and up, offering a unified API for Chrome and Firefox automation, based on WebDriver BiDi.
Can you please share issue link?
GitHub
Better error message for missing chromium system dependencies · Iss...
In some situations (like in docker containers), we fail to boot the binary because of missing system dependencies. Here is an example log: /home/vscode/.cache/astral/125.0.6400.0/chrome-linux64/chr...
already landed in main, I don't believe I've cut a release yet
https://github.com/lino-levan/astral/issues/84
created this issue for webdriver bidi if you want to follow it
GitHub
Support WebDriver BiDi · Issue #84 · lino-levan/astral
Firefox's CDP implementation is so incomplete that I believe the best course of action is to create a second backend for Astral. WebDriver BiDi is theoretically cross-browser compatible so in t...
So we should ditch Puppeteer by using astral?
If you're looking for a deno-native browser automation solution, that's what I would recommend (I also happen to be the author of the library so I have a bit of bias here).
Haha ok cool.