{
  "version": "1.0.0",
  "exported_at": "2026-06-03T15:30:00.000Z",
  "project": {
    "name": "b2bMAP Suppliers Scraper",
    "description": "Extracts supplier profile data from b2bMAP company detail pages. Uses a multi-URL navigation loop over supplied supplier profile URLs because the analyzed pages are individual profile pages with no on-page pagination. Add more b2bMAP supplier URLs to the Navigate block to scrape additional suppliers into b2bmap-suppliers.csv.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 120,
      "position_y": 240,
      "config": {
        "urls": [
          "https://b2bmap.com/fedus",
          "https://b2bmap.com/sds-enterprises",
          "https://b2bmap.com/panasonic-toughbook"
        ],
        "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": 480,
      "position_y": 240,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 840,
      "position_y": 240,
      "config": {
        "selector": "h1",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "rowSelector": "body",
        "fileName": "b2bmap-suppliers.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "directory",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); const val = label => { const wanted = label.toLowerCase(); for (const tr of document.querySelectorAll('tr')) { const cells = tr.querySelectorAll('td'); if (cells.length >= 3 && clean(cells[0].textContent).replace(':','').toLowerCase() === wanted) return clean(cells[cells.length - 1].innerText); } for (const r of document.querySelectorAll('.d-company-info-table .d-md-table-row')) { const cells = r.querySelectorAll('.d-md-table-cell'); if (cells.length >= 2 && clean(cells[0].innerText).replace(':','').toLowerCase().includes(wanted)) return clean(cells[1].innerText); } return ''; }; return val('Business Category'); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "company_name",
            "selector": "h1",
            "attribute": "text"
          },
          {
            "name": "details_url",
            "selector": "(() => window.location.href)()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "business_type",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); const val = label => { const wanted = label.toLowerCase(); for (const tr of document.querySelectorAll('tr')) { const cells = tr.querySelectorAll('td'); if (cells.length >= 3 && clean(cells[0].textContent).replace(':','').toLowerCase() === wanted) return clean(cells[cells.length - 1].innerText); } for (const r of document.querySelectorAll('.d-company-info-table .d-md-table-row')) { const cells = r.querySelectorAll('.d-md-table-cell'); if (cells.length >= 2 && clean(cells[0].innerText).replace(':','').toLowerCase().includes(wanted)) return clean(cells[1].innerText); } return ''; }; return val('Business Type'); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_category",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); const cat = document.querySelector('.category-title'); if (cat) return clean(cat.innerText); const side = document.querySelector('#subcategoryMenu li a'); return side ? clean(side.innerText).replace(/\\s*\\(\\d+\\)\\s*$/, '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "country_region",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); const val = label => { const wanted = label.toLowerCase(); for (const r of document.querySelectorAll('.d-company-info-table .d-md-table-row')) { const cells = r.querySelectorAll('.d-md-table-cell'); if (cells.length >= 2 && clean(cells[0].innerText).replace(':','').toLowerCase().includes(wanted)) return clean(cells[1].innerText); } return ''; }; const country = val('Country'); if (country) return country; const m = (document.title || '').match(/-\\s*(.+)$/); return m ? clean(m[1].split(',').pop()) : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "location",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); const m = (document.title || '').match(/-\\s*(.+)$/); return m ? clean(m[1]) : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "description",
            "selector": ".card .clean-link",
            "attribute": "text"
          },
          {
            "name": "founded_in",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); for (const tr of document.querySelectorAll('tr')) { const cells = tr.querySelectorAll('td'); if (cells.length >= 3 && clean(cells[0].textContent).replace(':','').toLowerCase() === 'founded in') return clean(cells[cells.length - 1].innerText); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "employees",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); for (const tr of document.querySelectorAll('tr')) { const cells = tr.querySelectorAll('td'); if (cells.length >= 3 && clean(cells[0].textContent).replace(':','').toLowerCase() === 'employees') return clean(cells[cells.length - 1].innerText); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "member_since",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); for (const tr of document.querySelectorAll('tr')) { const cells = tr.querySelectorAll('td'); if (cells.length >= 3 && clean(cells[0].textContent).replace(':','').toLowerCase() === 'member since') return clean(cells[cells.length - 1].innerText); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "membership_type",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); for (const tr of document.querySelectorAll('tr')) { const cells = tr.querySelectorAll('td'); if (cells.length >= 3 && clean(cells[0].textContent).replace(':','').toLowerCase() === 'membership type') return clean(cells[cells.length - 1].innerText); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "business_category",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); for (const tr of document.querySelectorAll('tr')) { const cells = tr.querySelectorAll('td'); if (cells.length >= 3 && clean(cells[0].textContent).replace(':','').toLowerCase() === 'business category') return clean(cells[cells.length - 1].innerText); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "main_products",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); for (const r of document.querySelectorAll('.d-company-info-table .d-md-table-row')) { const cells = r.querySelectorAll('.d-md-table-cell'); if (cells.length >= 2 && clean(cells[0].innerText).replace(':','').toLowerCase().includes('main products')) return clean(cells[1].innerText); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "register_address",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); for (const r of document.querySelectorAll('.d-company-info-table .d-md-table-row')) { const cells = r.querySelectorAll('.d-md-table-cell'); if (cells.length >= 2 && clean(cells[0].innerText).replace(':','').toLowerCase().includes('register address')) return clean(cells[1].innerText); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "zip_code",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); for (const r of document.querySelectorAll('.d-company-info-table .d-md-table-row')) { const cells = r.querySelectorAll('.d-md-table-cell'); if (cells.length >= 2 && clean(cells[0].innerText).replace(':','').toLowerCase().includes('zip code')) return clean(cells[1].innerText); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "factory_name",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); for (const r of document.querySelectorAll('.d-company-info-table .d-md-table-row')) { const cells = r.querySelectorAll('.d-md-table-cell'); if (cells.length >= 2 && clean(cells[0].innerText).replace(':','').toLowerCase().includes('factory name')) return clean(cells[1].innerText); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "factory_address",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); for (const r of document.querySelectorAll('.d-company-info-table .d-md-table-row')) { const cells = r.querySelectorAll('.d-md-table-cell'); if (cells.length >= 2 && clean(cells[0].innerText).replace(':','').toLowerCase().includes('factory address')) return clean(cells[1].innerText); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "factory_contact_person",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); for (const r of document.querySelectorAll('.d-company-info-table .d-md-table-row')) { const cells = r.querySelectorAll('.d-md-table-cell'); if (cells.length >= 2 && clean(cells[0].innerText).replace(':','').toLowerCase().includes('factory contact person')) return clean(cells[1].innerText); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "factory_details",
            "selector": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); for (const r of document.querySelectorAll('.d-company-info-table .d-md-table-row')) { const cells = r.querySelectorAll('.d-md-table-cell'); if (cells.length >= 2 && clean(cells[0].innerText).replace(':','').toLowerCase().includes('factory details')) return clean(cells[1].innerText); } return ''; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1560,
      "position_y": 240,
      "config": {}
    }
  ],
  "connections": [
    {
      "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": "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-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 136,
      "width": 1040,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1128,
      "position_y": 136,
      "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": 1488,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Extracts supplier profile data from b2bMAP company detail pages. Uses a multi-URL navigation loop over supplied supplier profile URLs because the analyzed pages are individual profile pages with no on-page pagination. Add more b2bMAP supplier URLs to the Navigate block to scrape additional suppliers into b2bmap-suppliers.csv.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (directory, details_url, business_type, product_category, country_region). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1400,
      "position_y": 220,
      "width": 340,
      "height": 137,
      "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": 1760,
      "position_y": 220,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}