Back

[SOLVED] Running Puppeteer with Appwrite function

  • 0
  • Self Hosted
  • Web
pingu
1 Jun, 2023, 15:53

Is it possible to run Puppeteer within a function? I keep getting a server error. By default Puppeteer installs a browser binary to use, but I am not sure if appwrite allows for such a scenario. I am an Appwrite newbie😅 .

My environment is node v16.0.0

TL;DR
The user was wondering if it is possible to run Puppeteer within an Appwrite function and was experiencing a server error. They found a solution by switching to Python and using Selenium with Browserless. The user also mentioned that including the binary in the function upload and referencing it might work. They shared a proposal for configuring a custom Docker image and suggested the user should raise an issue on the Appwrite GitHub repository.
Drake
1 Jun, 2023, 21:26

You could try including the binary in your function upload and referencing it that way.

You might want to 👍🏼 this issue: https://github.com/appwrite/appwrite/issues/1037

pingu
2 Jun, 2023, 09:28

The binary bloats the tar file which exceeds the upload limit. The proposal to configure your own docker image would be a great addition, that way I could have an environment that already has a browser binary. The weird thing is I've tried using Browserless which doesn't require a binary and the function still fails.

pingu
2 Jun, 2023, 12:09

I did it :appwriterocket: I figured it out using Browserless as suggested by @rohit.sangwan01 Thanks a bunch💯 I had to switch to Python though, running Puppeteer with node has some issues on Appwrite. The setup that worked for me is Python x Selenium xBrowserless. https://www.browserless.io/

pingu
2 Jun, 2023, 12:10

[SOLVED] Running Puppeteer with Appwrite function

rohit.sangwan01
2 Jun, 2023, 12:12

Dart also works good with browserless puppeteer , i have tried this in my library for whatsapp bot in dart: https://pub.dev/packages/whatsapp_bot_flutter#web-setup

rohit.sangwan01
2 Jun, 2023, 12:13
pingu
2 Jun, 2023, 12:18

Good stuff💯

Bouahaza
2 Jun, 2023, 12:41

You can create your own runtimes if needs, look here : https://github.com/open-runtimes/open-runtimes/tree/main/runtimes

Or have chromium worker outside appwrite, and call it from function

or call API sure, #1 is Zyte (scrapinghub), better proxy is bright data

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more