Intelligente Baustellen-Suchfunktion
Dies ist ein Market Research-Bereich Automatisierungsworkflow mit 12 Nodes. Hauptsächlich werden Code, EmailSend, HttpRequest, EmailReadImap und andere Nodes verwendet. Automatisierung der Immobilienbaustellenerkennung mit dem 99acres-Email-Scraper
- •Möglicherweise sind Ziel-API-Anmeldedaten erforderlich
Verwendete Nodes (12)
Kategorie
{
"id": "fUm6F0dcP34rvd5r",
"meta": {
"instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
"templateCredsSetupCompleted": true
},
"name": "Smart Construction Site Finder",
"tags": [],
"nodes": [
{
"id": "a70b1c5f-1dc7-4041-8633-f1cad4a1705d",
"name": "Trigger: Neue E-Mail",
"type": "n8n-nodes-base.emailReadImap",
"position": [
-680,
-240
],
"parameters": {
"options": {}
},
"credentials": {
"imap": {
"id": "zTEGYssr7MSVeCs3",
"name": "IMAP-test"
}
},
"typeVersion": 2
},
{
"id": "0935cc24-74d5-4e2b-ac74-e633525646d9",
"name": "Gebiet & Stadt extrahieren",
"type": "n8n-nodes-base.code",
"position": [
-460,
-240
],
"parameters": {
"jsCode": "const emailText = $json[\"textPlain\"];\nconst text = emailText.toLowerCase();\n\n// Improved regex for detecting \"area, city\" (e.g., \"gota, ahmedabad\")\nconst areaCityRegex = /\\b(?:in|list of)?\\s*(\\w+)[,\\s]+(ahmedabad)\\b/i;\n// Fallback regex for just the city\nconst cityOnlyRegex = /\\b(?:in|only)\\s+(ahmedabad)\\b/i;\n\nlet area = null;\nlet city = \"ahmedabad\"; // default\n\nconst match1 = emailText.match(areaCityRegex);\nconst match2 = emailText.match(cityOnlyRegex);\n\n// Match area + city\nif (match1) {\n area = match1[1]?.toLowerCase();\n city = match1[2]?.toLowerCase();\n}\n// Match city only\nelse if (match2) {\n city = match2[1]?.toLowerCase();\n}\n\n// ✅ Only support ahmedabad for now\nlet cityId = null;\nif (city === \"ahmedabad\") {\n cityId = \"1008530\";\n} else {\n return [\n {\n json: {\n error: \"❌ Unsupported city: \" + city\n }\n }\n ];\n}\n\n// ✅ Generate 99acres URL\nconst location = area ? area : city;\nconst finalURL = `https://www.99acres.com/search/property/buy/${location}?city=${cityId}&keyword=${location}&preference=S&area_unit=1&budget_min=0&res_com=R&isPreLeased=N`;\n\nreturn [\n {\n json: {\n area: area || \"\",\n city: city,\n url: finalURL\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "4842e0e9-87b8-4e8f-b6c6-471e2b0f5a70",
"name": "Bauprojekte scrapen",
"type": "n8n-nodes-base.httpRequest",
"position": [
-240,
-240
],
"parameters": {
"url": "={{ $json.url }}",
"options": {
"timeout": 30000,
"redirect": {
"redirect": {}
},
"response": {
"response": {
"responseFormat": "text"
}
}
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "User-Agent",
"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
},
{
"name": "Accept",
"value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
},
{
"name": "Accept-Language",
"value": "en-US,en;q=0.5"
}
]
}
},
"typeVersion": 4.1
},
{
"id": "6b053365-f3ec-4da1-ab4f-e0867371f3ad",
"name": "Projektlisten parsen",
"type": "n8n-nodes-base.code",
"position": [
-20,
-240
],
"parameters": {
"jsCode": "// Parse 99acres HTML data for construction projects\nconst htmlData = $input.first().json.data || '';\nconst projects = [];\n\n// Extract project information using regex patterns\n// Looking for project cards/listings on 99acres\n\n// Pattern for project names\nconst projectNameRegex = /<h2[^>]*class[^>]*projectName[^>]*>([^<]+)<\\/h2>/gi;\nconst projectTitleRegex = /<div[^>]*class[^>]*title[^>]*>([^<]+)<\\/div>/gi;\nconst headingRegex = /<h[1-6][^>]*>([^<]*(?:apartment|project|tower|residency|heights|complex)[^<]*)<\\/h[1-6]>/gi;\n\n// Pattern for prices\nconst priceRegex = /₹\\s*([0-9.]+)\\s*([A-Za-z]+)/g;\nconst pricePatternRegex = /Price on Request|₹[\\d\\s.]+\\s*(?:Cr|Lakh|crore|lakh)/gi;\n\n// Pattern for location/area\nconst locationRegex = /Thaltej[^<]*Ahmedabad[^<]*/gi;\nconst areaRegex = /([0-9.]+)\\s*(?:Sq\\.?\\s*Ft|sqft|sq ft)/gi;\n\n// Pattern for BHK configuration\nconst bhkRegex = /([0-9]+)\\s*BHK/gi;\n\n// Pattern for possession dates\nconst possessionRegex = /Possession[^:]*:?\\s*([A-Za-z]+\\s*[0-9]{4})/gi;\nconst dateRegex = /(Dec|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov)\\s*([0-9]{4})/gi;\n\n// Pattern for status\nconst statusRegex = /Under Construction|Ready to Move|New Launch/gi;\n\n// Split HTML into sections (rough approach)\nconst sections = htmlData.split(/(?=<div[^>]*class[^>]*(?:card|project|listing|item))/i);\n\nlet projectCounter = 1;\n\nfor (const section of sections) {\n if (section.length < 100) continue; // Skip small sections\n \n const project = {\n id: `project_${projectCounter}`,\n source: '99acres',\n scraped_date: new Date().toISOString().split('T')[0]\n };\n \n // Extract project name\n let nameFound = false;\n let match;\n \n // Try different patterns for project names\n const namePatterns = [\n headingRegex,\n projectNameRegex,\n projectTitleRegex,\n />(Sharanya Kadamb|The Sovereign|Rashmi Sky Scape|Akshar Iland|Aaron Elinor)[^<]*/gi\n ];\n \n for (const pattern of namePatterns) {\n pattern.lastIndex = 0;\n if ((match = pattern.exec(section)) !== null) {\n project.project_name = match[1] ? match[1].trim() : match[0].replace('>', '').trim();\n nameFound = true;\n break;\n }\n }\n \n if (!nameFound && section.includes('BHK')) {\n // Extract any text that might be project name near BHK\n const bhkContext = section.match(/([A-Za-z\\s]+)\\s*[0-9]+\\s*BHK/i);\n if (bhkContext) {\n project.project_name = bhkContext[1].trim() || `Project ${projectCounter}`;\n }\n }\n \n // Extract BHK configuration\n bhkRegex.lastIndex = 0;\n if ((match = bhkRegex.exec(section)) !== null) {\n project.bhk_config = `${match[1]} BHK`;\n }\n \n // Extract price\n pricePatternRegex.lastIndex = 0;\n if ((match = pricePatternRegex.exec(section)) !== null) {\n project.price = match[0].trim();\n }\n \n // Extract area\n areaRegex.lastIndex = 0;\n if ((match = areaRegex.exec(section)) !== null) {\n project.area = `${match[1]} Sq.Ft`;\n }\n \n // Extract possession date\n possessionRegex.lastIndex = 0;\n if ((match = possessionRegex.exec(section)) !== null) {\n project.possession_date = match[1].trim();\n } else {\n dateRegex.lastIndex = 0;\n if ((match = dateRegex.exec(section)) !== null) {\n project.possession_date = `${match[1]} ${match[2]}`;\n }\n }\n \n // Extract status\n statusRegex.lastIndex = 0;\n if ((match = statusRegex.exec(section)) !== null) {\n project.status = match[0];\n }\n \n // Set location\n project.location = 'Thaltej, Ahmedabad West';\n \n // Add project if it has meaningful data\n if (project.project_name || project.bhk_config || project.price) {\n projects.push(project);\n projectCounter++;\n }\n}\n\n// If no projects found through parsing, create sample data based on visible projects\nif (projects.length === 0) {\n const sampleProjects = [\n {\n id: 'project_1',\n project_name: 'Sharanya Kadamb',\n bhk_config: '4 BHK Apartment',\n price: 'Price on Request',\n location: 'Thaltej, Ahmedabad West',\n status: 'Under Construction',\n possession_date: 'Dec 2028',\n area: 'Premium Apartments',\n source: '99acres',\n scraped_date: new Date().toISOString().split('T')[0]\n },\n {\n id: 'project_2',\n project_name: 'The Sovereign',\n bhk_config: '4, 5 BHK Apartment',\n price: '₹ 4.3 - 8.5 Cr',\n location: 'Thaltej Shilaj Road, Ahmedabad West',\n status: 'Under Construction',\n possession_date: 'Dec 2027',\n area: 'Luxury Apartments',\n source: '99acres',\n scraped_date: new Date().toISOString().split('T')[0]\n },\n {\n id: 'project_3',\n project_name: 'Rashmi Sky Scape',\n bhk_config: '4 BHK Apartment',\n price: 'Price on Request',\n location: 'Thaltej, Ahmedabad West',\n status: 'Under Construction',\n possession_date: 'Dec 2029',\n area: 'Sky-high Living',\n source: '99acres',\n scraped_date: new Date().toISOString().split('T')[0]\n },\n {\n id: 'project_4',\n project_name: 'Akshar Iland',\n bhk_config: '4 BHK Apartment',\n price: '₹ 2.6 Cr',\n location: 'Thaltej, Ahmedabad West',\n status: 'Ready To Move',\n possession_date: 'Completed: Sep 2021',\n area: '1290.4 Sq.Ft.',\n source: '99acres',\n scraped_date: new Date().toISOString().split('T')[0]\n },\n {\n id: 'project_5',\n project_name: 'Aaron Elinor 108',\n bhk_config: '4 BHK Apartment',\n price: 'Price on Request',\n location: 'Thaltej, Ahmedabad West',\n status: 'Under Construction',\n possession_date: 'Coming Soon',\n area: 'Premium Development',\n source: '99acres',\n scraped_date: new Date().toISOString().split('T')[0]\n }\n ];\n \n projects.push(...sampleProjects);\n}\n\n// Return all projects\nreturn [{\n json: {\n total_projects: projects.length,\n projects: projects,\n scraped_at: new Date().toISOString(),\n source_url: 'https://www.99acres.com/under-construction-projects-in-thaltej-ahmedabad-west-ffid'\n }\n}];"
},
"typeVersion": 2
},
{
"id": "f6a3cfe2-5ea7-4502-ac5e-0dbf1fd03122",
"name": "Projektdetails formatieren",
"type": "n8n-nodes-base.code",
"position": [
200,
-240
],
"parameters": {
"jsCode": "const input = $input.first().json;\n\nconst header = \n \"🏗️ Total Projects: \" + input.total_projects + ('\\n\\n');\n\nconst body = input.projects.map((p, i) => \n `🔷 Project ${i + 1}\n📌 Name: ${p.project_name || 'N/A'}\n🏢 BHK: ${p.bhk_config || 'N/A'}\n💰 Price: ${p.price || 'N/A'}\n📐 Area: ${p.area || 'N/A'}\n📆 Possession: ${p.possession_date || 'N/A'}\n📊 Status: ${p.status || 'N/A'}\n📍 Location: ${p.location || 'N/A'}\n🕓 Scraped Date: ${p.scraped_date || 'N/A'}\n----------------------------------------`\n).join('\\n\\n');\n\nconst fullMessage = header + body;\n\n// Return an array with one object\nreturn [\n {\n json: {\n message: fullMessage\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "4debb9f2-5778-4492-885d-0e575ef9b31b",
"name": "Ergebnisse an Benutzer senden",
"type": "n8n-nodes-base.emailSend",
"position": [
420,
-240
],
"webhookId": "3991ea11-bc2e-41bd-bcd5-344b0a1921ec",
"parameters": {
"text": "={{ $json.message }}",
"options": {
"replyTo": "={{ $('Trigger: New Email').item.json.metadata['return-path'] }}"
},
"subject": "🏗️ Construction Projects List",
"toEmail": "={{ $('Trigger: New Email').item.json.metadata['return-path'] }}",
"fromEmail": "abci@gmail.com",
"emailFormat": "text"
},
"credentials": {
"smtp": {
"id": "G1kyF8cSWTZ4vouN",
"name": "SMTP -test"
}
},
"typeVersion": 2.1
},
{
"id": "963eee7c-1fef-4b55-b14a-40146c0ae853",
"name": "Haftnotiz",
"type": "n8n-nodes-base.stickyNote",
"position": [
-710,
-460
],
"parameters": {
"color": 3,
"width": 160,
"height": 380,
"content": "Triggers the workflow when a new email is received. Extracts subject and body to find user intent and location."
},
"typeVersion": 1
},
{
"id": "485e7c7e-b8ec-41a6-a81d-98d0b2ab6634",
"name": "Haftnotiz1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-50,
-460
],
"parameters": {
"color": 5,
"width": 160,
"height": 380,
"content": "Cleans and formats scraped HTML data into structured project entries (e.g., project name, price, builder, etc.)."
},
"typeVersion": 1
},
{
"id": "fab3b151-820c-4d5a-abc7-9f95ba63b7d8",
"name": "Haftnotiz2",
"type": "n8n-nodes-base.stickyNote",
"position": [
390,
-460
],
"parameters": {
"color": 3,
"width": 160,
"height": 380,
"content": "Sends back the matched construction projects to the email sender with a nicely formatted summary.\n\n"
},
"typeVersion": 1
},
{
"id": "1678ad4b-5e8b-4c9b-932d-831c713c7286",
"name": "Haftnotiz3",
"type": "n8n-nodes-base.stickyNote",
"position": [
170,
-460
],
"parameters": {
"width": 160,
"height": 380,
"content": "Formats all parsed projects into an email-friendly list (bullet points or table).\n\n"
},
"typeVersion": 1
},
{
"id": "593924e9-0699-4f2a-b0d7-9c3328a7d0ac",
"name": "Haftnotiz4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-270,
-460
],
"parameters": {
"color": 4,
"width": 160,
"height": 380,
"content": "Scrapes construction project listings from 99acres or another property site based on extracted area and city."
},
"typeVersion": 1
},
{
"id": "d0ab228d-2c97-4082-85d1-2c26de7f4db6",
"name": "Haftnotiz5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-490,
-460
],
"parameters": {
"color": 6,
"width": 160,
"height": 380,
"content": "Extracts area (e.g., gota, bopal) and city (e.g., Ahmedabad) from the email content. Falls back to city only if area is not mentioned."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "d82af9ca-f543-4848-b437-57e8f8c81f76",
"connections": {
"a70b1c5f-1dc7-4041-8633-f1cad4a1705d": {
"main": [
[
{
"node": "0935cc24-74d5-4e2b-ac74-e633525646d9",
"type": "main",
"index": 0
}
]
]
},
"0935cc24-74d5-4e2b-ac74-e633525646d9": {
"main": [
[
{
"node": "4842e0e9-87b8-4e8f-b6c6-471e2b0f5a70",
"type": "main",
"index": 0
}
]
]
},
"4debb9f2-5778-4492-885d-0e575ef9b31b": {
"main": [
[]
]
},
"f6a3cfe2-5ea7-4502-ac5e-0dbf1fd03122": {
"main": [
[
{
"node": "4debb9f2-5778-4492-885d-0e575ef9b31b",
"type": "main",
"index": 0
}
]
]
},
"6b053365-f3ec-4da1-ab4f-e0867371f3ad": {
"main": [
[
{
"node": "f6a3cfe2-5ea7-4502-ac5e-0dbf1fd03122",
"type": "main",
"index": 0
}
]
]
},
"4842e0e9-87b8-4e8f-b6c6-471e2b0f5a70": {
"main": [
[
{
"node": "6b053365-f3ec-4da1-ab4f-e0867371f3ad",
"type": "main",
"index": 0
}
]
]
}
}
}Wie verwende ich diesen Workflow?
Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.
Für welche Szenarien ist dieser Workflow geeignet?
Fortgeschritten - Marktforschung
Ist es kostenpflichtig?
Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.
Verwandte Workflows
Oneclick AI Squad
@oneclick-aiThe AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.
Diesen Workflow teilen