AutomationFlowsWeb Scraping › Compare Website SEO Gaps Using Google Sheets, HTML and Gemini AI

Compare Website SEO Gaps Using Google Sheets, HTML and Gemini AI

ByAvkash Kakdiya @itechnotion on n8n.io

This workflow automates SEO analysis by comparing your website with a competitor’s site. It reads input URLs from Google Sheets, scrapes structured SEO data from both sites, and expands into important internal pages for deeper insights. The collected data is processed and merged…

Event trigger★★★★★ complexityAI-powered47 nodesGoogle SheetsHTTP RequestGoogle Gemini
Web Scraping Trigger: Event Nodes: 47 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #14151 — we link there as the canonical source.

This workflow follows the Googlegemini → Google Sheets recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "68474035-4770-48f9-b559-21c2a383776d",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        10240,
        3232
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "44699fa5-8134-47da-bf36-3ac013d67d95",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        10464,
        3232
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit#gid=0",
          "cachedResultName": "INPUT_WEBSITES"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit?usp=drivesdk",
          "cachedResultName": "SEO_Workflow"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "710d381f-2b9d-4395-83f5-ab4ae1b6b824",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        10688,
        3232
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "bf16c862-c1ef-4d9f-81e9-3749143bda7c",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.Status }}",
              "rightValue": "NEW"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "a29b4fac-07eb-4294-8232-a6c6ffc09f1e",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        10912,
        3232
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "56d02d57-33ab-4848-9599-95b2dfabfb3c",
              "name": "your_site",
              "type": "string",
              "value": "={{ $json.Your_Website }}"
            },
            {
              "id": "16d1ff38-45ef-4056-aab7-7244d8e8b10e",
              "name": "competitor_site",
              "type": "string",
              "value": "={{ $json.Competitor_Website }}"
            },
            {
              "id": "16a913eb-8894-41ed-a1f4-46ec467a24cf",
              "name": "row_number",
              "type": "number",
              "value": "={{ $json.row_number }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "be5308ec-af61-4bcf-96dd-87f79b807387",
      "name": "HTML (for My website)",
      "type": "n8n-nodes-base.html",
      "position": [
        11360,
        2960
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "title",
              "cssSelector": "title"
            },
            {
              "key": "meta_description",
              "attribute": "content",
              "cssSelector": "meta[name=\"description\"]",
              "returnValue": "attribute"
            },
            {
              "key": "h1",
              "cssSelector": "h1"
            },
            {
              "key": "h2",
              "cssSelector": "h2",
              "returnArray": true
            },
            {
              "key": "content",
              "cssSelector": "p",
              "returnArray": true
            },
            {
              "key": "internal_links",
              "attribute": "href",
              "cssSelector": "a[href^=\"/\"]",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "external_links",
              "attribute": "href",
              "cssSelector": "a[href^=\"http\"]",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "image",
              "attribute": "src",
              "cssSelector": "img",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "all_links",
              "attribute": "href",
              "cssSelector": "a",
              "returnArray": true,
              "returnValue": "attribute"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "daeb3c9a-2a39-4a1e-a53e-ab893f54f71a",
      "name": "All Links (My Website)",
      "type": "n8n-nodes-base.code",
      "position": [
        11584,
        3088
      ],
      "parameters": {
        "jsCode": "const baseUrl = $('Edit Fields').first().json.your_site.replace(/\\/$/, '');\nconst links = $json.all_links || [];\n\nconst importantKeywords = [\n  \"about\",\n  \"service\",\n  \"solution\",\n  \"product\",\n  \"blog\",\n  \"case\",\n  \"portfolio\",\n  \"contact\",\n  \"career\"\n];\n\nconst pages = [];\n\nfor (let link of links) {\n\n  if (!link) continue;\n\n  let fullUrl = \"\";\n\n  // convert relative links to full URL\n  if (link.startsWith(\"/\")) {\n    fullUrl = baseUrl + link;\n  } \n  else if (link.startsWith(baseUrl)) {\n    fullUrl = link;\n  }\n\n  if (!fullUrl) continue;\n\n  // remove anchors and query params\n  fullUrl = fullUrl.split(\"#\")[0].split(\"?\")[0];\n\n  // check if link contains important keywords\n  const lowerUrl = fullUrl.toLowerCase();\n\n  const isImportant = importantKeywords.some(keyword =>\n    lowerUrl.includes(keyword)\n  );\n\n  if (isImportant) {\n    pages.push(fullUrl);\n  }\n}\n\n// always include homepage\npages.unshift(baseUrl);\n\n// remove duplicates\nconst uniquePages = [...new Set(pages)];\n\nreturn uniquePages.map(url => {\n  return {\n    json: {\n      page_url: url\n    }\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "ab4f1cfb-0516-48f6-a5f7-5b8605c0b8e5",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        12704,
        3088
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "ae03a1fc-7981-428d-bdc0-c24eb823b9e1",
      "name": "HTTP Request2",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        12928,
        3056
      ],
      "parameters": {
        "url": "={{ $('Get Rows from All links').item.json.Page_URL }}",
        "options": {
          "response": {
            "response": {}
          }
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "34c8b57b-140e-4d63-9854-f0479a064ddd",
      "name": "My Website HTTP",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        11136,
        2960
      ],
      "parameters": {
        "url": "={{ $json.your_site }}",
        "options": {
          "response": {
            "response": {}
          }
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "507ff63c-2184-49e5-afb3-e84e7c7da4fe",
      "name": "HTTP (for Competitor)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        11360,
        3472
      ],
      "parameters": {
        "url": "={{ $('Edit Fields').item.json.competitor_site }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "text"
            }
          }
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "c4617b95-ccad-4458-a672-d54276d8416a",
      "name": "HTML (for Competitor Website)",
      "type": "n8n-nodes-base.html",
      "position": [
        11584,
        3472
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "title",
              "cssSelector": "title"
            },
            {
              "key": "meta_description",
              "attribute": "content",
              "cssSelector": "meta[name=\"description\"]",
              "returnValue": "attribute"
            },
            {
              "key": "h1",
              "cssSelector": "h1"
            },
            {
              "key": "h2",
              "cssSelector": "h2",
              "returnArray": true
            },
            {
              "key": "content",
              "cssSelector": "p",
              "returnArray": true
            },
            {
              "key": "internal_links",
              "attribute": "href",
              "cssSelector": "a[href^=\"/\"]",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "external_links",
              "attribute": "href",
              "cssSelector": "a[href^=\"http\"]",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "image",
              "attribute": "src",
              "cssSelector": "img",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "all_links",
              "attribute": "href",
              "cssSelector": "a",
              "returnArray": true,
              "returnValue": "attribute"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7ee6b3ea-9f4a-46a5-b1bc-ad875a71dedb",
      "name": "Competitor Data",
      "type": "n8n-nodes-base.code",
      "position": [
        11808,
        3376
      ],
      "parameters": {
        "jsCode": "const item = $json;\n\n// paragraphs\nlet paragraphs = item.content || [];\nlet wordCount = 0;\n\nif (Array.isArray(paragraphs)) {\n  wordCount = paragraphs.join(\" \").split(/\\s+/).length;\n}\n\n// H2 cleanup\nlet h2 = [];\nif (Array.isArray(item.h2)) {\n  h2 = [...new Set(item.h2.map(h => h.trim()))];\n}\n\n// counts\nconst internalLinks = item.internal_links ? item.internal_links.length : 0;\nconst externalLinks = item.external_links ? item.external_links.length : 0;\nconst images = item.images ? item.images.length : 0;\n\nreturn [{\n  json: {\n    Website:$('Edit Fields').first().json.competitor_site ,\n    Page_URL:$('Edit Fields').first().json.competitor_site ,\n    Page_Title: item.title || \"\",\n    Meta_Description: item.meta_description || \"\",\n    H1: item.h1 || \"\",\n    H2: h2.join(\", \"),\n    Word_Count: wordCount,\n    Internal_Links: internalLinks,\n    External_Links: externalLinks,\n    Images: images,\n    Collected_Date: new Date().toISOString().split('T')[0]\n  }\n}];\n\n"
      },
      "typeVersion": 2
    },
    {
      "id": "6bb565e7-edfd-4c61-ba58-cf043a4b0d35",
      "name": "Append in Competitor Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        12032,
        3376
      ],
      "parameters": {
        "columns": {
          "value": {
            "H1": "={{ $json.H1 }}",
            "H2": "={{ $json.H2 }}",
            "ID": "={{ $('Get row(s) in sheet').item.json.ID }}",
            "Images": "={{ $json.Images }}",
            "Page_URL": "={{ $json.Page_URL }}",
            "Page_Title": "={{ $json.Page_Title }}",
            "Word_Count": "={{ $json.Word_Count }}",
            "Collected_Date": "={{ $json.Collected_Date }}",
            "External_Links": "={{ $json.External_Links }}",
            "Internal_Links": "={{ $json.Internal_Links }}",
            "Meta_Description": "={{ $json.Meta_Description }}",
            "Competitor_Website": "={{ $json.Website }}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Competitor_Website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Competitor_Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Page_URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Page_URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Page_Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Page_Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Meta_Description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Meta_Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "H1",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "H1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "H2",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "H2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Word_Count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Word_Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Internal_Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Internal_Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "External_Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "External_Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Images",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Images",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Collected_Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Collected_Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 178777114,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit#gid=178777114",
          "cachedResultName": "COMPETITOR_SEO_DATA"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit?usp=drivesdk",
          "cachedResultName": "SEO_Workflow"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "1c11904f-f422-4717-9094-a9e52d25e7f6",
      "name": "My Website Data",
      "type": "n8n-nodes-base.code",
      "position": [
        11584,
        2896
      ],
      "parameters": {
        "jsCode": "const item = $json;\n\n// paragraphs\nlet paragraphs = item.content || [];\nlet wordCount = 0;\n\nif (Array.isArray(paragraphs)) {\n  wordCount = paragraphs.join(\" \").split(/\\s+/).length;\n}\n\n// H2 cleanup\nlet h2 = [];\nif (Array.isArray(item.h2)) {\n  h2 = [...new Set(item.h2.map(h => h.trim()))];\n}\n\n// counts\nconst internalLinks = item.internal_links ? item.internal_links.length : 0;\nconst externalLinks = item.external_links ? item.external_links.length : 0;\nconst images = item.images ? item.images.length : 0;\n\nreturn [{\n  json: {\n    Website: $('Edit Fields').first().json.your_site,\n    Page_URL: $('Edit Fields').first().json.your_site,\n    Page_Title: item.title || \"\",\n    Meta_Description: item.meta_description || \"\",\n    H1: item.h1 || \"\",\n    H2: h2.join(\", \"),\n    Word_Count: wordCount,\n    Internal_Links: internalLinks,\n    External_Links: externalLinks,\n    Images: images,\n    Collected_Date: new Date().toISOString().split('T')[0]\n  }\n}];\n\n"
      },
      "typeVersion": 2
    },
    {
      "id": "3e25eabc-9fc7-4f48-9aa9-76c7f8dee8ae",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        12928,
        2864
      ],
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "80ee0e17-4219-4a9c-8c41-845fd8ec4b01",
      "name": "Append First Row of My website",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        11808,
        2896
      ],
      "parameters": {
        "columns": {
          "value": {
            "H1": "={{ $json.H1 }}",
            "H2": "={{ $json.H2 }}",
            "ID": "={{ $('Get row(s) in sheet').item.json.ID }}",
            "Images": "={{ $json.Images }}",
            "Website": "={{ $json.Website }}",
            "Page_URL": "={{ $json.Page_URL }}",
            "Page_Title": "={{ $json.Page_Title }}",
            "Word_Count": "={{ $json.Word_Count }}",
            "Collected_Date": "={{ $json.Collected_Date }}",
            "External_Links": "={{ $json.External_Links }}",
            "Internal_Links": "={{ $json.Internal_Links }}",
            "Meta_Description": "={{ $json.Meta_Description }}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Page_URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Page_URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Page_Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Page_Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Meta_Description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Meta_Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "H1",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "H1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "H2",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "H2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Word_Count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Word_Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Internal_Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Internal_Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "External_Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "External_Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Images",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Images",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Collected_Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Collected_Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 105835273,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit#gid=105835273",
          "cachedResultName": "YOUR_SEO_DATA"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit?usp=drivesdk",
          "cachedResultName": "SEO_Workflow"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "ff2d2f31-cdd3-474c-9253-0c24fcc1b90f",
      "name": "All Links (Competitor Website)",
      "type": "n8n-nodes-base.code",
      "position": [
        11808,
        3568
      ],
      "parameters": {
        "jsCode": "const baseUrl = $('Edit Fields').first().json.competitor_site.replace(/\\/$/, '');\nconst links = $json.all_links || [];\n\nconst importantKeywords = [\n  \"about\",\n  \"service\",\n  \"solution\",\n  \"product\",\n  \"blog\",\n  \"case\",\n  \"portfolio\",\n  \"contact\",\n  \"career\"\n];\n\nconst pages = [];\n\nfor (let link of links) {\n\n  if (!link) continue;\n\n  let fullUrl = \"\";\n\n  // convert relative links to full URL\n  if (link.startsWith(\"/\")) {\n    fullUrl = baseUrl + link;\n  } \n  else if (link.startsWith(baseUrl)) {\n    fullUrl = link;\n  }\n\n  if (!fullUrl) continue;\n\n  // remove anchors and query params\n  fullUrl = fullUrl.split(\"#\")[0].split(\"?\")[0];\n\n  // check if link contains important keywords\n  const lowerUrl = fullUrl.toLowerCase();\n\n  const isImportant = importantKeywords.some(keyword =>\n    lowerUrl.includes(keyword)\n  );\n\n  if (isImportant) {\n    pages.push(fullUrl);\n  }\n}\n\n// always include homepage\npages.unshift(baseUrl);\n\n// remove duplicates\nconst uniquePages = [...new Set(pages)];\n\nreturn uniquePages.map(url => {\n  return {\n    json: {\n      page_url: url\n    }\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "e53b714c-847d-4cd2-aeae-d7c4b839a11e",
      "name": "HTML (All Links My Web)",
      "type": "n8n-nodes-base.html",
      "onError": "continueRegularOutput",
      "position": [
        13152,
        3056
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "title",
              "cssSelector": "title"
            },
            {
              "key": "meta_description",
              "attribute": "content",
              "cssSelector": "meta[name=\"description\"]",
              "returnValue": "attribute"
            },
            {
              "key": "h1",
              "cssSelector": "h1"
            },
            {
              "key": "h2",
              "cssSelector": "h2",
              "returnArray": true
            },
            {
              "key": "content",
              "cssSelector": "p",
              "returnArray": true
            },
            {
              "key": "internal_links",
              "attribute": "href",
              "cssSelector": "a[href^=\"/\"]",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "external_links",
              "attribute": "href",
              "cssSelector": "a[href^=\"http\"]",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "image",
              "attribute": "src",
              "cssSelector": "img",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "all_links",
              "attribute": "href",
              "cssSelector": "a",
              "returnArray": true,
              "returnValue": "attribute"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e43db405-354d-42f5-84ee-cc5692bb2ddc",
      "name": "All Links Data (My Website)",
      "type": "n8n-nodes-base.code",
      "position": [
        13376,
        3184
      ],
      "parameters": {
        "jsCode": "const item = $json;\n\nlet paragraphs = item.content || [];\nlet wordCount = 0;\n\nif (Array.isArray(paragraphs)) {\n  wordCount = paragraphs.join(\" \").split(/\\s+/).length;\n}\n\nlet h2 = [];\nif (Array.isArray(item.h2)) {\n  h2 = [...new Set(item.h2.map(h => h.trim()))];\n}\n\nconst internalLinks = item.internal_links ? item.internal_links.length : 0;\nconst externalLinks = item.external_links ? item.external_links.length : 0;\nconst images = item.images ? item.images.length : 0;\n\nreturn [{\n  json: {\n    Website:$('Edit Fields').first().json.your_site ,\n    Page_URL: $input.first().json.page_url,\n    Page_Title: item.title || \"\",\n    Meta_Description: item.meta_description || \"\",\n    H1: item.h1 || \"\",\n    H2: h2.join(\", \"),\n    Word_Count: wordCount,\n    Internal_Links: internalLinks,\n    External_Links: externalLinks,\n    Images: images,\n    Collected_Date: new Date().toISOString().split('T')[0]\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "43a8335e-0d79-486a-9863-04223b62d516",
      "name": "Inserted All Links in sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        12032,
        3088
      ],
      "parameters": {
        "columns": {
          "value": {
            "Page_URL": "={{ $json.page_url }}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Page_URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Page_URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Page_Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Page_Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Meta_Description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Meta_Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "H1",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "H1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "H2",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "H2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Word_Count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Word_Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Internal_Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Internal_Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "External_Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "External_Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Images",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Images",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Collected_Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Collected_Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "All Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "All Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 105835273,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit#gid=105835273",
          "cachedResultName": "YOUR_SEO_DATA"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit?usp=drivesdk",
          "cachedResultName": "SEO_Workflow"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "bc127416-3d57-45db-ade3-28dcd66466d6",
      "name": "Inserted all Links (Competitor Website)",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        12032,
        3568
      ],
      "parameters": {
        "columns": {
          "value": {
            "Page_URL": "={{ $json.page_url }}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Competitor_Website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Competitor_Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Page_URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Page_URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Page_Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Page_Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Meta_Description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Meta_Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "H1",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "H1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "H2",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "H2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Word_Count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Word_Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Internal_Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Internal_Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "External_Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "External_Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Images",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Images",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Collected_Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Collected_Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 178777114,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit#gid=178777114",
          "cachedResultName": "COMPETITOR_SEO_DATA"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit?usp=drivesdk",
          "cachedResultName": "SEO_Workflow"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "529eed28-d597-4f46-8e0b-38b3d97b5432",
      "name": "Get row(s) in sheet2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        12480,
        3568
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.Page_URL }}",
              "lookupColumn": "Page_URL"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 178777114,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit#gid=178777114",
          "cachedResultName": "COMPETITOR_SEO_DATA"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit?usp=drivesdk",
          "cachedResultName": "SEO_Workflow"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "6df6de0a-49fe-40e3-a47d-23b4431ce135",
      "name": "Get Rows from All links",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        12480,
        3088
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.Page_URL }}",
              "lookupColumn": "Page_URL"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 105835273,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit#gid=105835273",
          "cachedResultName": "YOUR_SEO_DATA"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit?usp=drivesdk",
          "cachedResultName": "SEO_Workflow"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "565fbeef-3734-4b64-b515-f96c98faa22c",
      "name": "Loop Over Items1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        12704,
        3568
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "0bfb6ed4-4479-49e0-bf7a-e29e3e387d15",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        12928,
        3568
      ],
      "parameters": {
        "url": "={{ $('Get row(s) in sheet2').item.json.Page_URL }}",
        "options": {
          "response": {
            "response": {}
          }
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "926fbdee-7069-41d7-92d3-c1d95cd8948e",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        12928,
        3376
      ],
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "e9cba612-b849-4fbb-86f2-92f2ba2ecc85",
      "name": "Update row in Competitor Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        13152,
        3376
      ],
      "parameters": {
        "columns": {
          "value": {
            "H1": "={{ $json.H1 }}",
            "H2": "={{ $json.H2 }}",
            "Images": "={{ $json.Images }}",
            "Page_URL": "={{ $('Get row(s) in sheet2').item.json.Page_URL }}",
            "Page_Title": "={{ $json.Page_Title }}",
            "Word_Count": "={{ $json.Word_Count }}",
            "Collected_Date": "={{ $json.Collected_Date }}",
            "External_Links": "={{ $json.External_Links }}",
            "Internal_Links": "={{ $json.Internal_Links }}",
            "Meta_Description": "={{ $json.Meta_Description }}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Page_URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Page_URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Page_Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Page_Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Meta_Description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Meta_Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "H1",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "H1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "H2",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "H2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Word_Count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Word_Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Internal_Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Internal_Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "External_Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "External_Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Images",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Images",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Collected_Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Collected_Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "All Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "All Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Page_URL"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 178777114,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit#gid=178777114",
          "cachedResultName": "COMPETITOR_SEO_DATA"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit?usp=drivesdk",
          "cachedResultName": "SEO_Workflow"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "32f35dba-cdfd-4607-a3c6-6f053cbda20a",
      "name": "Update row in My Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        13152,
        2864
      ],
      "parameters": {
        "columns": {
          "value": {
            "H1": "={{ $json.H1 }}",
            "H2": "={{ $json.H2 }}",
            "Images": "={{ $json.Images }}",
            "Page_URL": "={{ $('Get Rows from All links').item.json.Page_URL }}",
            "Page_Title": "={{ $json.Page_Title }}",
            "Word_Count": "={{ $json.Word_Count }}",
            "Collected_Date": "={{ $json.Collected_Date }}",
            "External_Links": "={{ $json.External_Links }}",
            "Internal_Links": "={{ $json.Internal_Links }}",
            "Meta_Description": "={{ $json.Meta_Description }}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Page_URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Page_URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Page_Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Page_Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Meta_Description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Meta_Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "H1",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "H1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "H2",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "H2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Word_Count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Word_Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Internal_Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Internal_Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "External_Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "External_Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Images",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Images",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Collected_Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Collected_Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "All Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "All Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Page_URL"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 105835273,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit#gid=105835273",
          "cachedResultName": "YOUR_SEO_DATA"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit?usp=drivesdk",
          "cachedResultName": "SEO_Workflow"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "cf187f2f-73ba-465b-8f02-868867b5108e",
      "name": "Get All data from Competitor Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        13600,
        3376
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.Page_URL }}",
              "lookupColumn": "Page_URL"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 178777114,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit#gid=178777114",
          "cachedResultName": "COMPETITOR_SEO_DATA"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit?usp=drivesdk",
          "cachedResultName": "SEO_Workflow"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "333d1db3-9d3e-4544-82ee-d21d69d30a3a",
      "name": "Get All data from My Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        13600,
        2864
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.Page_URL }}",
              "lookupColumn": "Page_URL"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 105835273,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit#gid=105835273",
          "cachedResultName": "YOUR_SEO_DATA"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10CR_uR1PWHhLhtw2T_BVWQ1mFjwSkslkewfd7Og1EPI/edit?usp=drivesdk",
          "cachedResultName": "SEO_Workflow"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "823137e2-be7d-4e1f-a915-0e8c20e11a42",
      "name": "Wait2",
      "type": "n8n-nodes-base.wait",
      "position": [
        12256,
        3568
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "7cbd00ea-a22c-4e91-8d10-0032b4aa7b45",
      "name": "Wait3",
      "type": "n8n-nodes-base.wait",
      "position": [
        11808,
        3088
      ],
      "parameters": {
        "amount": 3
      },
      "typeVersion": 1.1
    },
    {
      "id": "3ccad78e-7925-4e16-89a2-fac8bf2685c8",
      "name": "Wait4",
      "type": "n8n-nodes-base.wait",
      "position": [
        12256,
        3088
      ],
      "parameters": {
        "amount": 3
      },
      "typeVersion": 1.1
    },
    {
      "id": "1f7979ac-e3ca-44fd-b242-cc5de34de3ce",
      "name": "Wait5",
      "type": "n8n-nodes-base.wait",
      "position": [
        13376,
        2864
      ],
      "parameters": {
        "amount": 3
      },
      "typeVersion": 1.1
    },
    {
      "id": "fed93104-844e-4b69-9fc9-b0f9ae9bcb66",
      "name": "Wait6",
      "type": "n8n-nodes-base.wait",
      "position": [
        13376,
        3376
      ],
      "parameters": {
        "amount": 3
      },
      "typeVersion": 1.1
    },
    {
      "id": "ff368ee4-1f22-43be-a0f0-b50c35344c15",
      "name": "HTML (All Links Competitor Website)",
      "type": "n8n-nodes-base.html",
      "onError": "continueRegularOutput",
      "position": [
        13152,
        3568
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "title",
              "cssSelector": "title"
            },
            {
              "key": "meta_description",
              "attribute": "content",
              "cssSelector": "meta[name=\"description\"]",
              "returnValue": "attribute"
            },
            {
              "key": "h1",
              "cssSelector": "h1"
            },
            {
              "key": "h2",
              "cssSelector": "h2",
              "returnArray": true
            },
            {
              "key": "content",
              "cssSelector": "p",
              "returnArray": true
            },
            {
              "key": "internal_links",
              "attribute": "href",
              "cssSelector": "a[href^=\"/\"]",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "external_links",
              "attribute": "href",
              "cssSelector": "a[href^=\"http\"]",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "image",
              "attribute": "src",
              "cssSelector": "img",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "all_links",
              "attribute": "href",
              "cssSelector": "a",
              "returnArray": true,
              "returnValue": "attribute"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5d64f117-269e-4b54-8c32-f0c697a7c05d",
      "name": "All Links Data (Competitor Website)",
      "type": "n8n-nodes-base.code",
      "position": [
        13376,
        3712
      ],
      "parameters": {
        "jsCode": "const item = $json;\n\nlet paragraphs = item.content || [];\nlet wordCount = 0;\n\nif (Array.isArray(paragraphs)) {\n  wordCount = paragraphs.join(\" \").split(/\\s+/).length;\n}\n\nlet h2 = [];\nif (Array.isArray(item.h2)) {\n  h2 = [...new Set(item.h2.map(h => h.trim()))];\n}\n\nconst internalLinks = item.internal_links ? item.internal_links.length : 0;\nconst externalLinks = item.external_links ? item.external_links.length : 0;\nconst images = item.images ? item.images.length : 0;\n\nreturn [{\n  json: {\n    Website:$('Edit Fields').first().json.your_site ,\n    Page_URL: $input.first().json.page_url,\n    Page_Title: item.title || \"\",\n    Meta_Description: item.meta_description || \"\",\n    H1: item.h1 || \"\",\n    H2: h2.join(\", \"),\n    Word_Count: wordCount,\n    Internal_Links: internalLinks,\n    External_Links: externalLinks,\n    Images: images,\n    Collected_Date: new Date().toISOString().split('T')[0]\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "0bffd008-4a60-4fce-bec2-1ea3e9f95ed3",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        13824,
        3232
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "ef02f8c5-1801-45b3-8b21-e99d5b8676cc",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        14048,
        3232
      ],
      "parameters": {
        "jsCode": "const yourData = [];\nconst competitorData = [];\n\nfor (const item of $input.all()) {\n\n  if (item.json.Website !== undefined) {\n    yourData.push(item.json);\n  }\n\n  if (item.json.Competitor_Website !== undefined) {\n    competitorData.push(item.json);\n  }\n\n}\n\nconst mergedData = {\n  your_website_data: yourData,\n  competitor_website_data: competitorData\n};\n\nreturn [\n  {\n    json: mergedData,\n    pairedItem: { item: 0 }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "54789e22-ace7-4981-b6fb-d6da04fd38a2",
      "name": "Code in JavaScript1",
      "type": "n8n-nodes-base.code",
      "position": [
        14624,
        3232
      ],
      "parameters": {
        "jsCode": "// Get Gemini response text\nlet rawText = $json.content.parts[0].text;\n\n// Remove markdown code blocks\nrawText = rawText.replace(/```json/g, '')\n                 .replace(/```/g, '')\n                 .trim();\n\n// Remove markdown bold (**text**)\nrawText = rawText.replace(/\\*\\*/g, '');\n\n// Extract JSON object\nconst jsonMatch = rawText.match(/\\{[\\s\\S]*\\}/);\n\nif (!jsonMatch) {\n  throw new Error(\"No valid JSON found in AI output: \" + rawText);\n}\n\nlet parsed;\n\ntry {\n  parsed = JSON.parse(jsonMatch[0]);\n} catch (error) {\n  throw new Error(\"AI output is not valid JSON: \" + jsonMatch[0]);\n}\n\n// Return parsed JSON\nreturn [\n  {\n    json: parsed\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "c3bba3b3-369c-4aef-a70e-c17550b86da7",
      "name": "Append row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        14848,
        3232
      ],
      "parameters": {
        "columns": {
          "value": {
            "ID": "={{ $json.ID }}",
         
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow automates SEO analysis by comparing your website with a competitor’s site. It reads input URLs from Google Sheets, scrapes structured SEO data from both sites, and expands into important internal pages for deeper insights. The collected data is processed and merged…

Source: https://n8n.io/workflows/14151/ — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Web Scraping

This template can be used to find the content gaps in your competitors' discourse: identifying the topics they are not yet connecting and giving you an opportunity to fill in this gap with your conten

HTTP Request, Html Extract, Google Docs +3
Web Scraping

Googletasks Http. Uses splitInBatches, httpRequest, stickyNote, html. Event-driven trigger; 17 nodes.

HTTP Request, Google Tasks, OpenAI +1
Web Scraping

Wait Code. Uses manualTrigger, httpRequest, htmlExtract, openAi. Event-driven trigger; 11 nodes.

HTTP Request, Html Extract, OpenAI +1
Web Scraping

Enrich your company lists with OpenAI GPT-3 ↓

HTTP Request, Html Extract, OpenAI +1
Web Scraping

Transform your event registration process with this comprehensive automation that eliminates manual certificate creation and ensures only verified attendees receive credentials.

HTTP Request, Gmail, Google Sheets +4