{
  "version": "1.0.0",
  "exported_at": "2026-06-01T12:10:00.000Z",
  "project": {
    "name": "Alksoto Listing Pages Scraper",
    "description": "Scrapes Alkosto keyword search/listing results for the sample keyword 'televisor', exporting keyword, product name, product URL, image URL, brand, description/spec snippets, price, and rating. Pagination is implemented with a click-next condition loop so all available result pages are appended to one CSV. Best-effort selectors are used because provided product sample URLs were stale/redirected or returned 404 during analysis; CAPTCHA or anti-bot checks may require manual intervention.",
    "color": "bg-[#e95e27]",
    "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": 456,
      "position_y": 220,
      "config": {
        "url": "https://www.alkosto.com/search/?text=televisor",
        "color": "bg-[#4589ff]",
        "tags": [
          "alkosto",
          "keyword-search",
          "televisor"
        ]
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 792,
      "position_y": 220,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "selector": "button[class*='accept' i], #onetrust-accept-btn-handler, button[id*='accept' i], .cookie button, [class*='cookie' i] button",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1464,
      "position_y": 520,
      "config": {
        "selector": "button[class*='accept' i], #onetrust-accept-btn-handler, button[id*='accept' i], .cookie button, [class*='cookie' i] button",
        "timeout": 8,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1800,
      "position_y": 520,
      "config": {
        "duration": 1,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 2136,
      "position_y": 520,
      "config": {
        "selector": "li.product__item, div.product__item, .product-item, .product-card, .productCard, .ais-Hits-item, [class*='product__list--item'], [data-product-code]",
        "timeout": 35,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2472,
      "position_y": 520,
      "config": {
        "rowSelector": "li.product__item, div.product__item, .product-item, .product-card, .productCard, .ais-Hits-item, [class*='product__list--item'], [data-product-code]",
        "fileName": "alksoto-listados-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "palabra_clave",
            "selector": "'televisor'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "producto",
            "selector": "(ROW.querySelector('[class*=\"product\" i][class*=\"name\" i], [class*=\"name\" i], [class*=\"title\" i], h2, h3, a[title]')?.innerText || ROW.querySelector('a[title]')?.getAttribute('title') || '').trim()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "producto_url",
            "selector": "(Array.from(ROW.querySelectorAll('a[href]')).find(a => a.href.includes('/p/')) || ROW.querySelector('a[href]'))?.href || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "imagen_url",
            "selector": "((v) => v ? new URL(v, location.origin).href : '')(ROW.querySelector('img[data-src*=\"/medias/\"]')?.getAttribute('data-src') || ROW.querySelector('img[src*=\"/medias/\"]')?.getAttribute('src') || ROW.querySelector('img[data-src]')?.getAttribute('data-src') || ROW.querySelector('img')?.getAttribute('src') || '')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "marca",
            "selector": "(ROW.querySelector('[class*=\"brand\" i], [data-brand]')?.innerText || ROW.getAttribute('data-brand') || ((ROW.querySelector('[class*=\"product\" i][class*=\"name\" i], [class*=\"name\" i], [class*=\"title\" i], h2, h3, a[title]')?.innerText || ROW.querySelector('a[title]')?.getAttribute('title') || '').trim().split(/\\s+/)[0]) || '').trim()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "descripcion",
            "selector": "Array.from(ROW.querySelectorAll('[class*=\"spec\" i], [class*=\"feature\" i], [class*=\"attribute\" i], [class*=\"description\" i] li, ul li')).map(e => e.innerText.trim()).filter(t => t && !/\\$\\s?[\\d.]+/.test(t)).slice(0, 12).join(' | ')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "precio",
            "selector": "(Array.from(ROW.querySelectorAll('[class*=\"price\" i], [class*=\"precio\" i], span, div')).map(e => e.innerText.trim()).find(t => /\\$\\s?[\\d.]+/.test(t)) || '').trim()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating",
            "selector": "((ROW.querySelector('[class*=\"rating\" i], [class*=\"stars\" i], [aria-label*=\"rating\" i], [aria-label*=\"calificación\" i]')?.innerText || ROW.querySelector('[class*=\"rating\" i], [class*=\"stars\" i], [aria-label*=\"rating\" i], [aria-label*=\"calificación\" i]')?.getAttribute('aria-label') || '').match(/\\d+([.,]\\d+)?/) || [''])[0]",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "element-exists-2",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 2808,
      "position_y": 520,
      "config": {
        "selector": ".pagination a[rel='next'], .pagination-next:not(.disabled) a, .pagination .next:not(.disabled) a, nav[aria-label*='pagination' i] a[aria-label*='next' i], nav[aria-label*='pagin' i] a[aria-label*='iguiente' i], a.pagination__next:not(.disabled)",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "click-2",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 3144,
      "position_y": 520,
      "config": {
        "selector": ".pagination a[rel='next'], .pagination-next:not(.disabled) a, .pagination .next:not(.disabled) a, nav[aria-label*='pagination' i] a[aria-label*='next' i], nav[aria-label*='pagin' i] a[aria-label*='iguiente' i], a.pagination__next:not(.disabled)",
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "wait-for-page-load-2",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 3480,
      "position_y": 520,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 3816,
      "position_y": 758,
      "config": {
        "duration": 2,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 2808,
      "position_y": 520,
      "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": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "to_block_id": "click-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-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": "element-exists-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "from_connector_id": "true",
      "to_block_id": "click-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "from_connector_id": "false",
      "to_block_id": "end-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-2",
      "from_connector_id": "right",
      "to_block_id": "wait-for-page-load-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-page-load-2",
      "from_connector_id": "right",
      "to_block_id": "sleep-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-2",
      "from_connector_id": "right",
      "to_block_id": "wait-for-element-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": 384,
      "position_y": 116,
      "width": 3680,
      "height": 834,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1",
          "wait-for-page-load-2",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1056,
      "position_y": 116,
      "width": 2336,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1",
          "element-exists-2",
          "click-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 2400,
      "position_y": 416,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 2736,
      "position_y": 416,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Alkosto keyword search/listing results for the sample keyword 'televisor', exporting keyword, product name, product URL, image URL, brand, description/spec snippets, price, and rating. Pagination is implemented with a click-next condition loop so all available result pages are appended to one CSV. Best-effort selectors are used because provided product sample URLs were stale/redirected or returned 404 during analysis; CAPTCHA or anti-bot checks may require manual intervention.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `button[class*='accept' i], #onetrust-accept-btn-handler, button[id*='accept' i], .cookie button, [class*='cookie' i] but`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1328,
      "position_y": 200,
      "width": 340,
      "height": 170,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (palabra_clave, producto, producto_url, imagen_url, marca). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2672,
      "position_y": 500,
      "width": 340,
      "height": 132,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-element-exists-2",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `.pagination a[rel='next'], .pagination-next:not(.disabled) a, .pagination .next:not(.disabled) a, nav[aria-label*='pagin`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 3008,
      "position_y": 500,
      "width": 340,
      "height": 170,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-2"
      }
    },
    {
      "id": "note-block-click-2",
      "element_type": "note",
      "title": "Note: Click",
      "content": "Pagination click — add waits after this block; the page reloads asynchronously.",
      "color": "#ee5396",
      "position_x": 3344,
      "position_y": 500,
      "width": 316,
      "height": 106,
      "z_index": 22,
      "data": {
        "block_id": "click-2"
      }
    }
  ]
}