{
  "version": "1.0.0",
  "exported_at": "2026-05-31T13:05:00.000Z",
  "project": {
    "name": "Reddit Post  Comments Scraper Free",
    "description": "Best-effort old.reddit.com post and comments scraper equivalent to the Octoparse Reddit Post & Comments Scraper. Uses a multi-URL navigation loop for pasted Reddit thread/comment URLs, expands old Reddit 'load more comments' links when present, and appends visible post/comment/reply rows to reddit-scraper.csv. Reddit returned 403 network-policy blocks during analysis and testing, so this version writes a diagnostic row for blocked URLs instead of silently producing no output. Login/developer credentials, compliant API access, or a trusted browser profile may be required for real Reddit comment data.",
    "color": "bg-[#ff4500]",
    "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": {
        "urls": [
          "https://old.reddit.com/r/dogpictures/comments/154fqlh/how_does_my_baby_look/jsomc2m/",
          "https://old.reddit.com/r/dogpictures/comments/154fqlh/how_does_my_baby_look/jspcacx/"
        ],
        "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": 792,
      "position_y": 220,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "text-contains-1",
      "block_type": "process",
      "title": "Text Contains",
      "description": "Check if page contains text",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "text": "blocked due to a network policy",
        "timeout": 5,
        "caseSensitive": false,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "structured-export-2",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1464,
      "position_y": 520,
      "config": {
        "rowSelector": "body",
        "fileName": "reddit-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#da1e28]",
        "columns": [
          {
            "name": "Subreddit",
            "selector": "location.pathname.split('/')[2] || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Post_title",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Post_upvote",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Post_author",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Post_text",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Number_of_comments",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Post_image",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Comment_link",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Main_comment_author",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Main_comment_post_time",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Main_comment_upvote",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Main_comment_text",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Main_comment_image",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Reply_user",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Reply_text",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Reply_upvote",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Reply_time",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Reply_image",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Last_level_commment_author",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Last_level_comment_text",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Last_level_upvote",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Last_level_comment_time",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "source_url",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "scrape_status",
            "selector": "'blocked_by_reddit_network_policy'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "block_message",
            "selector": "document.body.innerText.trim().slice(0, 500)",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-2",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1800,
      "position_y": 520,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1128,
      "position_y": 520,
      "config": {
        "selector": ".thing.link",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1632,
      "position_y": 800,
      "config": {
        "selector": ".commentarea .morecomments a",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1968,
      "position_y": 800,
      "config": {
        "selector": ".commentarea .morecomments a",
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2304,
      "position_y": 800,
      "config": {
        "duration": 2,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2640,
      "position_y": 800,
      "config": {
        "rowSelector": ".commentarea .thing.comment",
        "fileName": "reddit-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "Subreddit",
            "selector": "(() => { return document.querySelector('.thing.link a.subreddit')?.textContent?.replace('r/','').trim() || location.pathname.split('/')[2] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Post_title",
            "selector": "document.querySelector('.thing.link a.title')?.textContent?.trim() || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Post_upvote",
            "selector": "document.querySelector('.thing.link .score.unvoted, .thing.link .score.likes, .thing.link .score.dislikes')?.textContent?.trim() || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Post_author",
            "selector": "document.querySelector('.thing.link .tagline a.author')?.textContent?.trim() || document.querySelector('.thing.link')?.getAttribute('data-author') || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Post_text",
            "selector": "document.querySelector('.thing.link .usertext-body .md')?.innerText?.trim() || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Number_of_comments",
            "selector": "(() => { const t=document.querySelector('.thing.link a.comments')?.textContent || ''; return t.replace(/[^0-9]/g,''); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Post_image",
            "selector": "(() => { const post=document.querySelector('.thing.link'); const img=post?.querySelector('.expando img.preview, .expando img, a.thumbnail img'); if (img?.src) return img.src; const href=post?.querySelector('a.title')?.href || ''; const h=href.toLowerCase(); return (h.includes('preview.redd.it') || h.includes('i.redd.it') || ['.jpg','.jpeg','.png','.gif','.webp'].some(e=>h.includes(e))) ? href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Comment_link",
            "selector": "(() => { const p=ROW.getAttribute('data-permalink') || ROW.querySelector('a.bylink, a.permalink')?.getAttribute('href') || ''; return p ? new URL(p, location.origin).href : location.href; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Main_comment_author",
            "selector": "(() => { const top=(row)=>{let cur=row; for(let i=0;i<12;i++){const p=cur.getAttribute('data-parent')||''; if(!p || p.startsWith('t3_')) return cur; const parent=document.querySelector('.thing.comment[data-fullname=\"'+p+'\"]'); if(!parent) return cur; cur=parent;} return cur;}; const t=top(ROW); return t.getAttribute('data-author') || t.querySelector('a.author')?.textContent?.trim() || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Main_comment_post_time",
            "selector": "(() => { const top=(row)=>{let cur=row; for(let i=0;i<12;i++){const p=cur.getAttribute('data-parent')||''; if(!p || p.startsWith('t3_')) return cur; const parent=document.querySelector('.thing.comment[data-fullname=\"'+p+'\"]'); if(!parent) return cur; cur=parent;} return cur;}; const t=top(ROW); const time=t.querySelector('time.live-timestamp, time'); return time?.getAttribute('datetime') || time?.getAttribute('title') || time?.textContent?.trim() || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Main_comment_upvote",
            "selector": "(() => { const top=(row)=>{let cur=row; for(let i=0;i<12;i++){const p=cur.getAttribute('data-parent')||''; if(!p || p.startsWith('t3_')) return cur; const parent=document.querySelector('.thing.comment[data-fullname=\"'+p+'\"]'); if(!parent) return cur; cur=parent;} return cur;}; const t=top(ROW); return t.querySelector('.score.unvoted, .score.likes, .score.dislikes')?.textContent?.trim() || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Main_comment_text",
            "selector": "(() => { const top=(row)=>{let cur=row; for(let i=0;i<12;i++){const p=cur.getAttribute('data-parent')||''; if(!p || p.startsWith('t3_')) return cur; const parent=document.querySelector('.thing.comment[data-fullname=\"'+p+'\"]'); if(!parent) return cur; cur=parent;} return cur;}; const t=top(ROW); return t.querySelector('.usertext-body .md')?.innerText?.trim() || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Main_comment_image",
            "selector": "(() => { const top=(row)=>{let cur=row; for(let i=0;i<12;i++){const p=cur.getAttribute('data-parent')||''; if(!p || p.startsWith('t3_')) return cur; const parent=document.querySelector('.thing.comment[data-fullname=\"'+p+'\"]'); if(!parent) return cur; cur=parent;} return cur;}; const t=top(ROW); const img=t.querySelector('.usertext-body img'); if(img?.src) return img.src; const a=Array.from(t.querySelectorAll('.usertext-body a')).find(a=>{const h=a.href.toLowerCase(); return h.includes('preview.redd.it') || h.includes('i.redd.it') || ['.jpg','.jpeg','.png','.gif','.webp'].some(e=>h.includes(e));}); return a?.href || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Reply_user",
            "selector": "(() => { const p=ROW.getAttribute('data-parent') || ''; return p && !p.startsWith('t3_') ? (ROW.getAttribute('data-author') || ROW.querySelector('a.author')?.textContent?.trim() || '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Reply_text",
            "selector": "(() => { const p=ROW.getAttribute('data-parent') || ''; return p && !p.startsWith('t3_') ? (ROW.querySelector('.usertext-body .md')?.innerText?.trim() || '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Reply_upvote",
            "selector": "(() => { const p=ROW.getAttribute('data-parent') || ''; return p && !p.startsWith('t3_') ? (ROW.querySelector('.score.unvoted, .score.likes, .score.dislikes')?.textContent?.trim() || '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Reply_time",
            "selector": "(() => { const p=ROW.getAttribute('data-parent') || ''; if(!p || p.startsWith('t3_')) return ''; const time=ROW.querySelector('time.live-timestamp, time'); return time?.getAttribute('datetime') || time?.getAttribute('title') || time?.textContent?.trim() || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Reply_image",
            "selector": "(() => { const p=ROW.getAttribute('data-parent') || ''; if(!p || p.startsWith('t3_')) return ''; const img=ROW.querySelector('.usertext-body img'); if(img?.src) return img.src; const a=Array.from(ROW.querySelectorAll('.usertext-body a')).find(a=>{const h=a.href.toLowerCase(); return h.includes('preview.redd.it') || h.includes('i.redd.it') || ['.jpg','.jpeg','.png','.gif','.webp'].some(e=>h.includes(e));}); return a?.href || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Last_level_commment_author",
            "selector": "ROW.getAttribute('data-author') || ROW.querySelector('a.author')?.textContent?.trim() || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Last_level_comment_text",
            "selector": "ROW.querySelector('.usertext-body .md')?.innerText?.trim() || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Last_level_upvote",
            "selector": "ROW.querySelector('.score.unvoted, .score.likes, .score.dislikes')?.textContent?.trim() || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Last_level_comment_time",
            "selector": "(() => { const time=ROW.querySelector('time.live-timestamp, time'); return time?.getAttribute('datetime') || time?.getAttribute('title') || time?.textContent?.trim() || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "source_url",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "scrape_status",
            "selector": "'ok'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "block_message",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2976,
      "position_y": 800,
      "config": {
        "duration": 1,
        "color": "bg-[#8d8d8d]"
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 3312,
      "position_y": 800,
      "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": "text-contains-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "text-contains-1",
      "from_connector_id": "true",
      "to_block_id": "structured-export-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-2",
      "from_connector_id": "right",
      "to_block_id": "loop-continue-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "text-contains-1",
      "from_connector_id": "false",
      "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": "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": "structured-export-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": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "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": "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": 384,
      "position_y": 116,
      "width": 2840,
      "height": 876,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1056,
      "position_y": 116,
      "width": 2504,
      "height": 876,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "text-contains-1",
          "loop-continue-2",
          "element-exists-1",
          "click-1",
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1392,
      "position_y": 416,
      "width": 1496,
      "height": 576,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-2",
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort old.reddit.com post and comments scraper equivalent to the Octoparse Reddit Post & Comments Scraper. Uses a multi-URL navigation loop for pasted Reddit thread/comment URLs, expands old Reddit 'load more comments' links when present, and appends visible post/comment/reply rows to reddit-scraper.csv. Reddit returned 403 network-policy blocks during analysis and testing, so this version writes a diagnostic row for blocked URLs instead of silently producing no output. Login/developer credentials, compliant API access, or a trusted browser profile may be required for real Reddit comment data.",
      "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 2 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 656,
      "position_y": 200,
      "width": 328,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-text-contains-1",
      "element_type": "note",
      "title": "Note: Text Contains",
      "content": "Condition block: checks ``. 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": 130,
      "z_index": 22,
      "data": {
        "block_id": "text-contains-1"
      }
    },
    {
      "id": "note-block-structured-export-2",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (Subreddit, Post_title, Post_upvote, Post_author, Post_text). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1664,
      "position_y": 500,
      "width": 340,
      "height": 133,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-2"
      }
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `.commentarea .morecomments a`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1832,
      "position_y": 780,
      "width": 340,
      "height": 139,
      "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 (Subreddit, Post_title, Post_upvote, Post_author, Post_text). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2840,
      "position_y": 780,
      "width": 340,
      "height": 133,
      "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": 3512,
      "position_y": 780,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}