スマートな建設現場検索ツール

中級

これはMarket Research分野の自動化ワークフローで、12個のノードを含みます。主にCode, EmailSend, HttpRequest, EmailReadImapなどのノードを使用。 99acresメールクリーパで不動産建設工地の発見を自動化する

前提条件
  • ターゲットAPIの認証情報が必要な場合あり

カテゴリー

ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "fUm6F0dcP34rvd5r",
  "meta": {
    "instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
    "templateCredsSetupCompleted": true
  },
  "name": "Smart Construction Site Finder",
  "tags": [],
  "nodes": [
    {
      "id": "a70b1c5f-1dc7-4041-8633-f1cad4a1705d",
      "name": "トリガー: 新着メール",
      "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": "エリアと都市の抽出",
      "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": "建築プロジェクトのスクレイピング",
      "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": "プロジェクトリストの解析",
      "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": "プロジェクト詳細のフォーマット",
      "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": "結果のユーザーへの送信",
      "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": "付箋",
      "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": "付箋1",
      "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": "付箋2",
      "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": "付箋3",
      "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": "付箋4",
      "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": "付箋5",
      "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
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級 - 市場調査

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
中級
ノード数12
カテゴリー1
ノードタイプ5
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

作成者
Oneclick AI Squad

Oneclick AI Squad

@oneclick-ai

The 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.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34