I am new to javascripting, i am trying to use puppeteer inside function node and i am not finding relevant document for puppeteer in N8N.
What i am trying to achieve is that, we have a URL for which we have to authenticate and take a screen shot of that page. I ran some simple nodejs code to achieve the same where its working fine on my vscode. I dont know how to use the same code inside N8N.
flow -
URL ----> N8N fucntion node ----> Pass the screenshot to the next node
the code i am using is the sample one that is ready avaiable on the internet.
Do you want to use Puppeteer to take screenshots of websites? If yes, I recently published a node in n8n that can help you here. This node uses the Pageres library, which under the hood uses Puppeteer.
I tired installing the new node using npm -g flag, and the node got installed, however when i fire up the GUI, i am not finding that node… what am i missing ? please help
Alright, i figured it out and now that i have the node installed, when try to run the node, i get the following error.
ERROR: Protocol error (Emulation.setDeviceMetricsOverride): Invalid parameters Failed to deserialize params.height - BINDINGS: int32 value expected at position 31
at /usr/local/lib/node_modules/n8n/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:208:63
at new Promise (<anonymous>)
at CDPSession.send (/usr/local/lib/node_modules/n8n/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:207:16)
at EmulationManager.emulateViewport (/usr/local/lib/node_modules/n8n/node_modules/puppeteer/lib/cjs/puppeteer/common/EmulationManager.js:20:26)
at Page.setViewport (/usr/local/lib/node_modules/n8n/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:968:58)
at captureWebsite (/usr/local/lib/node_modules/n8n/node_modules/capture-website/index.js:223:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at Pageres.create (/usr/local/lib/node_modules/n8n/node_modules/pageres/dist/index.js:220:28)
at Pageres.viewport (/usr/local/lib/node_modules/n8n/node_modules/pageres/dist/index.js:160:29)```
Sorry for the delay in response. I am glad that you figured out the solution. Can you please share it here so that others can also benefit from it? I’ll also update the documentation of the node.
To answer your question on auth, it looks like Pageres does allow you to pass username and password. However, the node currently doesn’t support that feature. Feel free to send a PR. I’ll be happy to merge and ship it!
sure, for the error which is reported on the top of this thread…
ERROR: Protocol error (Emulation.setDeviceMetricsOverride): Invalid parameters Failed to deserialize params.height - BINDINGS: int32 value expected at position 31
at /usr/local/lib/node_modules/n8n/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:208:63
at new Promise (<anonymous>)
at CDPSession.send (/usr/local/lib/node_modules/n8n/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:207:16)
at EmulationManager.emulateViewport (/usr/local/lib/node_modules/n8n/node_modules/puppeteer/lib/cjs/puppeteer/common/EmulationManager.js:20:26)
at Page.setViewport (/usr/local/lib/node_modules/n8n/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:968:58)
at captureWebsite (/usr/local/lib/node_modules/n8n/node_modules/capture-website/index.js:223:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at Pageres.create (/usr/local/lib/node_modules/n8n/node_modules/pageres/dist/index.js:220:28)
at Pageres.viewport (/usr/local/lib/node_modules/n8n/node_modules/pageres/dist/index.js:160:29)```
This issue was due to resolution, in the pagers node resolution is a mandatory so that has to be set for the node to work properly…
Hi, just wanted to share this as it can help others. We’re running n8n in Kubernetes, so in order to use puppeteer we needed puppeteer (and chromium) to be part of the n8n docker image.
Hi i’m unclear as to what the requirements to make a puppeteer node work in a non-dockerised n8n installation on a LXC. It seems i can install via a plugin (easy) or I can do via npm. Don’t know the difference (why would I need to install via npm?). Why is there a credentials field in the node in n8n (if i use the plugin version)? Credentials for what exactly? thanks