How To Deploy Puppeteer Script in Vercel via CLI & GitHub in 2022

preview_player
Показать описание

This puppeteer tutorial is designed for beginners to learn how to use the node js puppeteer library to perform web scraping, testing, and creating website bots. Puppeteer is a Node library that provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default but can be configured to run full (non-headless) Chrome or Chromium.

Donate
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Bitcoin Wallet: bc1q05j8gcnq4mzvgj603cxdc8xxck4jgnu2ljsrt4
Ethereum Wallet: 0x5e7BD4f473f153d400b39D593A55D68Ce80F8a2e

Social
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

Intro (0:00)
Setup Puppeteer Script (0:31)
Vercel CLI Deployment (4:54)
GitHub Deployment (7:00)

Tags:
- Nodejs Tutorials
- Puppeteer Nodejs
- Nodejs Puppeteer Tutorial
- Puppeteer Tutorial for Beginners

#nodejs #puppeteer #webscraping
Рекомендации по теме
Комментарии
Автор

Also asking if you could look into how to do this with Node 18 / newer versions of puppeteer and chromium on vercel. Thx!

cobbler
Автор

hi michael ! work perfectly !
Your tutorials are superb

juguetestoys
Автор

Hi, node 14 is not support now, only ^18 supported, but change to 18, It can't run well now

luhuoyanshan
Автор

can you make a video but with nextjs as they have the api routes that we could use, i get an error for the aws lambda like this after downloading and need help (the problem shows after copying what you did here and it just can't seem to work)

let chrome = {};
let puppeteer;
let options = {};
if {
chrome =
puppeteer = require("puppeteer-core");
} else {
puppeteer = require("puppeteer");
}
if {
options = {
args: [...chrome.args, "--hide-scrollbars", "--disable-web-security"],
defaultViewport: chrome.defaultViewport,
executablePath: await chrome.executablePath,
headless: true,
ignoreHTTPSErrors: true,
};
}

export const getBrowser = async () => {

return await puppeteer.launch(options);
}

- error
Module parse failed: Unexpected token (1:10)
> {"version":3, "file":"Browser.js", "sourceRoot":"", "sources":["../../../source/puppeteer/lib/Browser.ts"], "names":[], "mappings":";;AAGA, IAAI, KAAK, GAAuB, IAAI, CAAC;AAErC, IAAI;IACF, KAAK, GAAG, OAAO, CAAC, 4CAA4C, CAAC, CAAC, OAAO, CAAC;CACvE;AAAC, OAAO, KAAK, EAAE;IACd, KAAK, GAAG, OAAO, CAAC, iDAAiD, CAAC, CAAC, OAAO, CAAC;CAC5E;AAED, KAAK, CAAC, SAAS, CAAC, WAAW, GAAG, KAAK, WAAW, GAAG, KAAa;IAC5D, IAAI, IAAI, GAAS, IAAI, CAAC;IACtB, IAAI, KAAK, GAAW, MAAM, IAAI, CAAC, KAAK, EAAE, CAAC;IAEvC, IAAI, KAAK, CAAC, MAAM, KAAK, CAAC, EAAE;QACtB, KAAK, GAAG, CAAC, MAAM, IAAI, CAAC, OAAO, EAAE, CAAC, CAAC;KAChC;IAED, IAAI, GAAG, KAAK, CAAC, KAAK, EAAE, CAAC;IAErB, IAAI, KAAK, IAAI, IAAI, IAAI, KAAK, CAAC, OAAO, CAAC, KAAK, CAAC, KAAK, IAAI, EAAE;QAClD, KAAK, IAAI, IAAI, IAAI, KAAK, EAAE;YACtB, IAAI, GAAG, MAAM, IAAI, CAAC, IAAI, CAAC, CAAC;SACzB;KACF;IAED, OAAO, IAAI, CAAC;AACd, CAAC, CAAC;AAEF, IAAI, OAAO, GAAQ, KAAK, CAAC, SAAS, CAAC, OAAO, CAAC;AAE3C, KAAK, CAAC, SAAS, CAAC, OAAO, GAAG, KAAK, WAAW, GAAG, KAAa;IACxD, IAAI, IAAI, GAAS, MAAM, OAAO, CAAC, KAAK, CAAC, IAAI, EAAE, SAAS, CAAC, CAAC;IAEtD, IAAI, KAAK, IAAI, IAAI, IAAI, KAAK, CAAC, OAAO, CAAC, KAAK, CAAC, KAAK, IAAI, EAAE;QAClD, KAAK, IAAI, IAAI, IAAI, KAAK, EAAE;YACtB, IAAI, GAAG, MAAM, IAAI, CAAC, IAAI, CAAC, CAAC;SACzB;KACF;IAED, OAAO, IAAI, CAAC;AACd, CAAC, CAAC"}

Gobi_Gobi
Автор

Pretty nice tuto, but I've a message on Vercel that the function size is too big (52MB) and exceeds the 50 standard MB :/

BrontoKroxig
Автор

thank you much, you saved me a lot of time and headache of trying to make this work, liked and subscribed

mehdiahmed
Автор

Thanks for this tutorial, I learned a lot of deployment, so many error. In the end vercel is not good to scrape, the basic tier have a request time of 5 seconds, that's impossible to scrape something in that time, after that the server goes to sleep mode and you get a time out error.

KuroManX
Автор

I am facing an error code it is says server less function not found

Vercel, i have followed your tutorial exactly but I don’t why this issue is occurring please help

akshatparmar
Автор

hi micheal,
i am using whatsapp-web pkg in nodejs and this pkg uses pupetteer
in their documentaion they said they have given some command to run on linux server
how can i run that command in vercel because i want to deploy my nodejs on vercel but vercel blocks this pkg due to serverless function

arslanahmed
Автор

Please respond from the channel owner. Is it possible to publish puppeteer on render because I could not publish it?

CodeConcoctions
Автор

Thanks, but i believe vercel depreciated node14 from build therefore builds are failing. And this ONLY works kn node14. Correct me if im wrong? Any help appreciated.

DreamingMaldives
Автор

Thanks. Never knew puppeteer would be this much of a pain in the a*ss to setup. Thanks for the video!

iyobosajefferson
Автор

Sir please make video on playwright how to "deploy" playwright code on vercel or any ware so please make video on this topic sir

tausifkhan
Автор

if possible, please upload the repo with updated code

abdulrafay
Автор

An error occurred with your deployment

FUNCTION_INVOCATION_TIMEOUT

dioncley
Автор

Can u make a video on the best free alternatives to heroku since heroku is removing their free plans for puppeteer

rohanganatra
Автор

I followed your tutorial. It works amazing. But sometimes it times out the function. How can I display a error using express and not the vercel” branded error

akshatparmar
Автор

A bit confusing but works fine, thanks!

janis
Автор

Node 14 is now discontinued, so this one fails.

KutluMizrak
Автор

very complicated config i guess there are others example more better than this !

kamalkamals