From eb9d2b33bd0d2c8e92cb8df3b81efe955bad9d95 Mon Sep 17 00:00:00 2001 From: gitea Date: Mon, 1 Jan 2001 00:00:00 +0000 Subject: [PATCH] Update MyDealz Kommentare.json --- MyDealz Kommentare.json | 276 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 259 insertions(+), 17 deletions(-) diff --git a/MyDealz Kommentare.json b/MyDealz Kommentare.json index 7f355a5..e11812d 100644 --- a/MyDealz Kommentare.json +++ b/MyDealz Kommentare.json @@ -1,9 +1,9 @@ { - "updatedAt": "2025-12-19T21:17:56.000Z", + "updatedAt": "2025-12-21T22:32:12.000Z", "createdAt": "2025-11-11T20:49:50.649Z", "id": "Gd9XJHdc1J3gFMiS", "name": "MyDealz Kommentare", - "active": true, + "active": false, "isArchived": false, "nodes": [ { @@ -26,8 +26,8 @@ "type": "CUSTOM.puppeteer", "typeVersion": 1, "position": [ - 144, - -208 + 320, + -272 ], "id": "b64956ef-5fd3-4978-971f-a2739b4de5b2", "name": "Puppeteer: Cookie Banner click", @@ -50,8 +50,8 @@ "type": "CUSTOM.puppeteer", "typeVersion": 1, "position": [ - 464, - -208 + 192, + -432 ], "id": "4ae95d94-e70a-4bbf-a43d-5629e6504d40", "name": "Puppeteer: Extract Comments", @@ -130,8 +130,8 @@ "type": "n8n-nodes-base.telegramTrigger", "typeVersion": 1.2, "position": [ - -256, - 16 + -992, + -240 ], "id": "b5577d9f-e3b6-4830-927a-f65b6170cf21", "name": "Telegram Trigger", @@ -438,18 +438,187 @@ ], "id": "77eda26f-6a0f-4ec0-ba8e-6a4e64d1bf05", "name": "Merge1" + }, + { + "parameters": { + "assignments": { + "assignments": [ + { + "id": "7b5eaa92-e327-4b25-9d62-2b87114d6eda", + "name": "user_name", + "value": "Chamosoa", + "type": "string" + }, + { + "id": "1f06109a-8abc-410d-9d05-ed7232360f11", + "name": "password", + "value": "ranjan", + "type": "string" + }, + { + "id": "257c1f53-f614-49fc-aba2-0174b39f0b3c", + "name": "cookie_path", + "value": "mydealz_cookies.json", + "type": "string" + }, + { + "id": "b2ed032d-2fa4-45f1-8cb1-d16002c21f98", + "name": "js_functions", + "value": " async function button_click_hide(selector) {\n await $page.locator(selector).click();\n await $page.waitForSelector(selector, { hidden: true}); \n }\n\n async function cookie_banner_click(){\n const banner_reject = 'button[data-t=\"rejectAll\"]';\n await button_click_hide(banner_reject);\n }", + "type": "string" + }, + { + "id": "9fdfffcf-4959-48a4-8dcb-8ea9bdc4999c", + "name": "set_viewport", + "value": "await $page.setViewport({\n width: 1920,\n height: 1080\n});", + "type": "string" + }, + { + "id": "69f0b999-df03-4303-a381-b26a2eca8809", + "name": "image_data", + "value": "const imageData = await $page.screenshot({ type: \"png\", encoding: \"base64\" });\n\nconst img_binary = {\n binary: {\n screenshot: {\n data: imageData,\n mimeType: \"image/png\",\n fileName: \"screenshot.png\",\n },\n },\n};", + "type": "string" + } + ] + }, + "options": {} + }, + "type": "n8n-nodes-base.set", + "typeVersion": 3.4, + "position": [ + -720, + -240 + ], + "id": "4dc4330e-5722-4ece-a8bd-558b9547b5bf", + "name": "global_params" + }, + { + "parameters": { + "fileSelector": "={{ $json.cookie_path }}", + "options": {} + }, + "type": "n8n-nodes-base.readWriteFile", + "typeVersion": 1, + "position": [ + -512, + -240 + ], + "id": "93b3a9ec-c846-4d81-821d-2574a06c5601", + "name": "read_json_from_disk" + }, + { + "parameters": { + "conditions": { + "options": { + "caseSensitive": true, + "leftValue": "", + "typeValidation": "strict", + "version": 2 + }, + "conditions": [ + { + "id": "8f9097ff-2cfc-4b2b-a73b-63f1ece02537", + "leftValue": "={{$('read_json_from_disk')}}", + "rightValue": "", + "operator": { + "type": "object", + "operation": "exists", + "singleValue": true + } + } + ], + "combinator": "and" + }, + "options": {} + }, + "type": "n8n-nodes-base.if", + "typeVersion": 2.2, + "position": [ + -336, + -240 + ], + "id": "05f39920-48b9-45ea-b466-aacd1ea26c0d", + "name": "If1" + }, + { + "parameters": { + "operation": "fromJson", + "options": {} + }, + "type": "n8n-nodes-base.extractFromFile", + "typeVersion": 1.1, + "position": [ + -144, + -432 + ], + "id": "bca1ed08-45eb-4a89-94b6-0aa5b1a4af33", + "name": "convert_to_json" + }, + { + "parameters": { + "operation": "runCustomScript", + "scriptCode": "=// Navigate to an IP lookup service\n await $page.setViewport({\n width: 1920,\n height: 1080\n });\n\nconst user_name = '{{ $('Edit Fields1').item.json.user_name }}';\nconst password = '{{ $('Edit Fields1').item.json.password }}';\n\n async function button_click_hide(selector) {\n await $page.locator(selector).click();\n await $page.waitForSelector(selector, { hidden: true}); \n }\n\n const deal_url = \"https://www.mydealz.de/\";\n await $page.goto(deal_url, { waitUntil: ['load', 'domcontentloaded'] });\n //const element = await $page.waitForSelector('button[data-t=\"rejectAll\"');\n\n //Cookie banner click\n //await $page.locator('button[data-t=\"rejectAll\"').click();\n //await $page.waitForSelector('button[data-t=\"rejectAll\"', { hidden: true});\n const banner_reject = 'button[data-t=\"rejectAll\"]';\n await button_click_hide(banner_reject);\n\n await $page.goto(deal_url, { waitUntil: ['load', 'domcontentloaded'] });\n\n\n //Login\n const login_menu = 'button[data-t=\"login\"]';\n const login_name = 'input[name=\"identity\"]';\n const login_password = 'input[name=\"password\"]';\n // const nav_menu = 'div.nav-search--navigation >>> ::-p-text(Einloggen oder registrieren)';\n const nav_menu = 'div.nav-search--navigation button[data-t=\"login\"]';\n const next_selector = 'button[type=\"submit\"] >>> ::-p-text(Weiter)';\n const login_selector = 'button[type=\"submit\"] >>> ::-p-text(Einloggen)';\n \nawait $page.locator(nav_menu).click();\nawait $page.locator(login_name).fill(user_name);\nawait $page.locator(next_selector).click();\nawait $page.locator(login_password).fill(password);\nawait button_click_hide(login_selector);\n\n const cookies = await $page.cookies();\n const imageData = await $page.screenshot({ type: \"png\", encoding: \"base64\" });\n\n const img_binary = {\n binary: {\n screenshot: {\n data: imageData,\n mimeType: \"image/png\",\n fileName: \"screenshot.png\",\n },\n },\n };\n\n const html_content = await $page.content();\n\n\n result = [];\n //result.push(html_content);\n //result.push(img_binary)\nresult.push(cookies);\n\n\n\n return result", + "options": { + "launchArguments": { + "args": [ + { + "arg": "--disable-features=HttpsFirstBalancedModeAutoEnable" + }, + { + "arg": "--no-sandbox" + } + ] + }, + "stealth": true + } + }, + "type": "CUSTOM.puppeteer", + "typeVersion": 1, + "position": [ + -144, + -128 + ], + "id": "944d9fd4-c855-403b-92e3-47f833dcfa79", + "name": "Puppeteer: Cookie Banner click2", + "onError": "continueRegularOutput" + }, + { + "parameters": { + "operation": "write", + "fileName": "={{ $('Edit Fields1').item.json.cookie_path }}", + "dataPropertyName": "=data", + "options": { + "append": false + } + }, + "type": "n8n-nodes-base.readWriteFile", + "typeVersion": 1, + "position": [ + 240, + -128 + ], + "id": "5ae369d8-da0d-44ad-b1f4-bcbb87e4a5cc", + "name": "Read/Write Files from Disk" + }, + { + "parameters": { + "operation": "toJson", + "options": {} + }, + "type": "n8n-nodes-base.convertToFile", + "typeVersion": 1.1, + "position": [ + 64, + -128 + ], + "id": "8a0d69bb-ab00-4443-8a64-11c75102c547", + "name": "Convert to File" } ], "connections": { "Puppeteer: Cookie Banner click": { "main": [ - [ - { - "node": "Puppeteer: Extract Comments", - "type": "main", - "index": 0 - } - ] + [] ] }, "Puppeteer: Extract Comments": { @@ -483,7 +652,7 @@ "main": [ [ { - "node": "Puppeteer: Cookie Banner click", + "node": "global_params", "type": "main", "index": 0 } @@ -601,6 +770,79 @@ } ] ] + }, + "global_params": { + "main": [ + [ + { + "node": "read_json_from_disk", + "type": "main", + "index": 0 + } + ] + ] + }, + "read_json_from_disk": { + "main": [ + [ + { + "node": "If1", + "type": "main", + "index": 0 + } + ] + ] + }, + "convert_to_json": { + "main": [ + [ + { + "node": "Puppeteer: Extract Comments", + "type": "main", + "index": 0 + } + ] + ] + }, + "If1": { + "main": [ + [ + { + "node": "convert_to_json", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "Puppeteer: Cookie Banner click2", + "type": "main", + "index": 0 + } + ] + ] + }, + "Convert to File": { + "main": [ + [ + { + "node": "Read/Write Files from Disk", + "type": "main", + "index": 0 + } + ] + ] + }, + "Puppeteer: Cookie Banner click2": { + "main": [ + [ + { + "node": "Convert to File", + "type": "main", + "index": 0 + } + ] + ] } }, "settings": { @@ -611,7 +853,7 @@ "templateCredsSetupCompleted": true }, "pinData": {}, - "versionId": "33297958-4515-41c5-9c0c-3de99ec2ac5c", + "versionId": "03108c1a-6ab8-4383-80f0-141492134b02", "triggerCount": 1, "shared": [ {