Puppeteer with n8n

selfhosted Version 1.70.3

installed puppeteer but not sure how to get page contents out. i run here
default test but console log does not output anything

{
  "nodes": [
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const puppeteer = require('puppeteer');\n\nasync function main() {\n    const browser = await puppeteer.launch();\n    const page = await browser.newPage();\n\n    // Navigate the page to a URL.\n    await page.goto('https://developer.chrome.com/');\n\n    // Set screen size.\n    await page.setViewport({width: 1080, height: 1024});\n\n    // Type into search box.\n    await page.locator('.devsite-search-field').fill('automate beyond recorder');\n\n    // Wait and click on first result.\n    await page.locator('.devsite-result-item-link').click();\n\n    // Locate the full title with a unique string.\n    const textSelector = await page.locator('text/Customize and automate').waitHandle();\n    const fullTitle = await textSelector?.evaluate(el => el.textContent);\n\n    // Print the full title.\n    console.log('The title of this blog post is \"%s\".', fullTitle);\n\n    await browser.close();\n}\n\n// Execute the function\n$o =  main();\nconsole.log($o);\n\n$input.item.json.content = $o;\n\nreturn $input.item;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -240,
        240
      ],
      "id": "0fd77451-92dd-4a63-860a-745cfa28a5f4",
      "name": "Code1"
    }
  ],
  "connections": {},
  "pinData": {}
}```

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Did you find a solution for this? I’m having the same issue.

In case it’s relevant, n8n 1.86.1, SQLite, default executions_process, Docker on UnRAID 7.0.1.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.