Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with Scrape function #14

Open
jyoung2000 opened this issue Nov 19, 2024 · 1 comment
Open

Error with Scrape function #14

jyoung2000 opened this issue Nov 19, 2024 · 1 comment

Comments

@jyoung2000
Copy link

Loving the community node so far, everything works great except the scrape feature. Here is the error it produces

{
"errorMessage": "Bad request - please check your parameters",
"errorDescription": "Request failed with status code 400",
"errorDetails": {
"rawErrorMessage": [
"Request failed with status code 400"
],
"httpCode": "400"
},
"n8nDetails": {
"nodeName": "Browserless",
"nodeType": "n8n-nodes-browserless.browserless",
"nodeVersion": 2,
"resource": "Browser Rest Apis",
"operation": "Scrape",
"itemIndex": 0,
"runIndex": 0,
"time": "11/18/2024, 10:06:47 PM",
"n8nVersion": "1.49.0 (Self Hosted)",
"binaryDataMode": "default",
"stackTrace": [
"NodeApiError: Bad request - please check your parameters",
" at Object.httpRequestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1187:15)",
" at processTicksAndRejections (node:internal/process/task_queues:95:5)",
" at Object.httpRequestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2077:20)",
" at RoutingNode.rawRoutingRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/RoutingNode.js:337:29)",
" at RoutingNode.makeRoutingRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/RoutingNode.js:423:28)",
" at async Promise.allSettled (index 0)",
" at RoutingNode.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/RoutingNode.js:156:35)",
" at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:775:23)",
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:673:51",
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1085:20"
]
}
}

image

@ruohki
Copy link

ruohki commented Mar 4, 2025

same think the issue is either the waitForTimeout not beeing part of the api anymore or it doesnt like the default value of 0.

Edit: You can fix this by creating a new workflow with a webhook and basically proxy the request to browserless

{
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "b6aff53f-e923-40d6-ba5a-b893acd95f70/scrape",
        "responseMode": "responseNode",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "id": "ce2ceb03-d85b-4e17-842b-1c1695f6d9b1",
      "name": "Webhook",
      "webhookId": "b6aff53f-e923-40d6-ba5a-b893acd95f70"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://192.168.128.5:3000/scrape",
        "sendBody": true,
        "contentType": "=json",
        "specifyBody": "json",
        "bodyParameters": {
          "parameters": [
            {}
          ]
        },
        "jsonBody": "={{ { url: $json.body.url, elements: $json.body.elements, userAgent: $json.body.userAgent, rejectResourceTypes: $json.body.rejectResourceTypes } }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        220,
        0
      ],
      "id": "0639a0af-00c5-49e9-8893-67e99df41721",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "respondWith": "allIncomingItems",
        "options": {}
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        420,
        0
      ],
      "id": "2bda4887-8630-4940-96e8-49d80e215ce0",
      "name": "Respond to Webhook"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "instanceId": "b5eaa4adbceb093f30069b21722a7b248d6e221145b863df3bea34459f1435b3"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants