{
  "version": "1.0.0",
  "exported_at": "2026-06-03T00:00:00.000Z",
  "project": {
    "name": "Itown page details_cloud only",
    "description": "Extracts iTown / itp.ne.jp business detail data from a list of detail-page URLs: company name, email address, current iTown URL, phone number, homepage URL, original input/current URL, and a No_detail_page status. Navigation uses a multi-URL input loop with append-mode CSV export so all supplied detail URLs are processed. Live analysis returned Access Denied from itp.ne.jp, so extraction uses robust JavaScript fallbacks and flags blocked/no-detail pages. Phone extraction is disabled on Access Denied pages to avoid matching digits from blocked-page URLs.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Set browser window dimensions",
      "position_x": 120,
      "position_y": 220,
      "config": {
        "width": 1920,
        "height": 1080,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 480,
      "position_y": 220,
      "config": {
        "urls": [
          "https://itp.ne.jp/zenkoku/osaka/osakashi-higashisumiyoshiku/kumata/277702645196130760",
          "https://itp.ne.jp/zenkoku/osaka/osakashi-sumiyoshiku/karita/271314872300000899",
          "https://itp.ne.jp/aichi/nagoyashi-nakamuraku/meieki/-/-/-/236123765200000899",
          "https://itp.ne.jp/tokyo/hachiojishi/betsushiyo/-/-/-/130023717101040180",
          "https://itp.ne.jp/aichi/nagoyashi-nakamuraku/noritake/-/-/-/231766655200000899"
        ],
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 840,
      "position_y": 220,
      "config": {
        "timeout": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 220,
      "config": {
        "duration": 2,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1560,
      "position_y": 220,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 220,
      "config": {
        "rowSelector": "body",
        "fileName": "Itown-page-details-cloud-only.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "会社名",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); const blocked = /Access Denied|permission to access|errors\\.edgesuite\\.net/i.test(document.body.innerText || ''); if (blocked) return ''; const candidates = ['h1', '[data-testid*=company]', '[data-testid*=shop]', '[class*=companyName]', '[class*=company-name]', '[class*=shopName]', '[class*=shop-name]', '[class*=storeName]', '[class*=store-name]', '[class*=name]', '.title']; for (const sel of candidates) { const el = document.querySelector(sel); const txt = clean(el && el.textContent); if (txt && !/iタウンページ|itown|電話帳|地図|アクセス|詳細/i.test(txt)) return txt; } const og = document.querySelector('meta[property=\"og:title\"], meta[name=\"twitter:title\"]')?.content; if (og) return clean(og.replace(/\\s*[|｜-].*$/, '')); const title = clean(document.title || ''); return /Access Denied/i.test(title) ? '' : title.replace(/\\s*[|｜-].*$/, ''); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "メールアドレス",
            "selector": "(() => { const text = document.body.innerText || ''; if (/Access Denied|permission to access|errors\\.edgesuite\\.net/i.test(text)) return ''; const href = Array.from(document.querySelectorAll('a[href^=\"mailto:\"]')).map(a => a.getAttribute('href').replace(/^mailto:/i, '').split('?')[0].trim()).find(Boolean); if (href) return href; const m = text.match(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}/i); return m ? m[0] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "URL",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "電話番号",
            "selector": "(() => { const pageText = document.body.innerText || ''; if (/Access Denied|permission to access|errors\\.edgesuite\\.net/i.test(pageText)) return ''; const tel = Array.from(document.querySelectorAll('a[href^=\"tel:\"]')).map(a => (a.textContent || a.getAttribute('href') || '').replace(/^tel:/i, '').trim()).find(Boolean); if (tel) return tel; const text = pageText.replace(/\\s+/g, ' '); const labelMatch = text.match(/(?:電話番号|TEL|Tel|tel)[:：\\s]*((?:\\(代\\)\\s*;?\\s*)?(?:0\\d{1,4}[-ー−―]\\d{1,4}[-ー−―]\\d{3,4}|0120[-ー−―]\\d{3}[-ー−―]\\d{3}|0\\d{9,10}))/i); if (labelMatch) return labelMatch[1].trim(); const m = text.match(/(?:\\(代\\)\\s*;?\\s*)?(?:0\\d{1,4}[-ー−―]\\d{1,4}[-ー−―]\\d{3,4}|0120[-ー−―]\\d{3}[-ー−―]\\d{3})/); return m ? m[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ホームページ",
            "selector": "(() => { const text = document.body.innerText || ''; if (/Access Denied|permission to access|errors\\.edgesuite\\.net/i.test(text)) return ''; const links = Array.from(document.querySelectorAll('a[href]')).map(a => { try { return new URL(a.getAttribute('href'), location.href).href; } catch(e) { return ''; } }).filter(Boolean); const external = links.find(u => !/^(https?:\\/\\/)?([^\\/]*\\.)?itp\\.ne\\.jp\\//i.test(u) && !/^mailto:|^tel:/i.test(u) && !/google|yahoo|bing|facebook|twitter|x\\.com|instagram|line\\.me|maps|edgesuite/i.test(u)); return external || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "オリジナル_URL",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "No_detail_page",
            "selector": "(() => { const text = document.body.innerText || ''; if (/Access Denied|permission to access|errors\\.edgesuite\\.net/i.test(text)) return 'Access Denied'; if (/404|ページが見つかりません|Not Found|お探しのページ/i.test(text)) return 'No detail page'; const hasBusinessSignal = document.querySelector('h1') || document.querySelector('a[href^=\"tel:\"]') || document.querySelector('a[href^=\"mailto:\"]') || /電話番号|TEL|ホームページ|会社|店舗|住所/.test(text); return hasBusinessSignal ? '' : 'No detail page'; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2280,
      "position_y": 220,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "connections": [
    {
      "from_block_id": "set-window-size-1",
      "from_connector_id": "right",
      "to_block_id": "navigate-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "navigate-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-page-load-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-page-load-1",
      "from_connector_id": "right",
      "to_block_id": "sleep-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-1",
      "from_connector_id": "right",
      "to_block_id": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "loop-continue-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 48,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "set-window-size-1"
        ]
      }
    },
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 408,
      "position_y": 116,
      "width": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 2208,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Extracts iTown / itp.ne.jp business detail data from a list of detail-page URLs: company name, email address, current iTown URL, phone number, homepage URL, original input/current URL, and a No_detail_page status. Navigation uses a multi-URL input loop with append-mode CSV export so all supplied detail URLs are processed. Live analysis returned Access Denied from itp.ne.jp, so extraction uses robust JavaScript fallbacks and flags blocked/no-detail pages. Phone extraction is disabled on Access Denied pages to avoid matching digits from blocked-page URLs.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-navigate-1",
      "element_type": "note",
      "title": "Note: Navigate",
      "content": "Multi-URL loop over 5 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 680,
      "position_y": 200,
      "width": 328,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (会社名, メールアドレス, URL, 電話番号, ホームページ). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 200,
      "width": 340,
      "height": 124,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-loop-continue-1",
      "element_type": "note",
      "title": "Note: Loop Continue",
      "content": "Loop Continue advances a multi-URL or multi-text loop. Place at the end of the loop body with a clear back-edge to the loop start.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 200,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}