Skip to main content

Scrape and store data from multiple website pages

Workflow preview

Workflow preview
100%
Scrape and store data from multiple website pages preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow allows extracting data from multiple pages website. The workflow: 1) Starts in a country list at https://www.theswiftcodes.com/browse by country/. 2) Loads every country page (https:/...

Best for

  • Engineering automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.httprequest, n8n-nodes-base.htmlextract, n8n-nodes-base.splitinbatches, n8n-nodes-base.mongodb, n8n-nodes-base.uproc, n8n-nodes-base.function, n8n-nodes-base.if

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Miquel Colomer.

Original n8n.io source

1.1 Workflow description

Title
Scrape and store data from multiple website pages
Workflow name
Scrape and store data from multiple website pages

This workflow allows extracting data from multiple pages website.

The workflow:

  1. Starts in a country list at https://www.theswiftcodes.com/browse-by-country/.
  2. Loads every country page (https://www.theswiftcodes.com/albania/)
  3. Paginates every page in the country page.
  4. Extracts data from the country page.
  5. Saves data to MongoDB.
  6. Paginates through all pages in all countries.

It uses getWorkflowStaticData('global') method to recover the next page (saved from the previous page), and it goes ahead with all the pages.

There is a first section where the countries list is recovered and extracted.

Later, I try to read if a local cache page is available and I recover the cached page from the disk.

Finally, I save data to MongoDB, and we paginate all the pages in the country and for all the countries.

I have applied a cache system to save a visited page to n8n local disk. If I relaunch workflow, we check if a cache file exists to discard non-required requests to the webpage.

If the data present in the website changes, you can apply a Cron node to check the website once per week.

Finally, before inserting data in MongoDB, the best way to avoid duplicates is to check that swift_code (the primary value of the collection) doesn't exist.

I recommend using a proxy for all requests to avoid IP blocks. A good solution for proxy plus IP rotation is scrapoxy.io.

This workflow is perfect for small data requirements. If you need to scrape dynamic data, you can use a Headless browser or any other service.

If you want to scrape huge lists of URIs, I recommend using Scrapy + Scrapoxy.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - On clicking 'execute'

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - HTTP Request

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 1

Block 3 - HTML Extract

Type / Role
n8n-nodes-base.htmlExtract - htmlExtract
Config choices
Version 1

Block 4 - SplitInBatches

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 1

Block 5 - HTTP Request1

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 1

Block 6 - HTML Extract1

Type / Role
n8n-nodes-base.htmlExtract - htmlExtract
Config choices
Version 1

Block 7 - MongoDB1

Type / Role
n8n-nodes-base.mongoDb - mongoDb
Config choices
Version 1

Block 8 - uProc

Type / Role
n8n-nodes-base.uproc - uproc
Config choices
Version 1

Block 9 - Prepare Documents

Type / Role
n8n-nodes-base.function - function
Config choices
Version 1

Block 10 - More Countries

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 11 - Set Page to Scrape

Type / Role
n8n-nodes-base.functionItem - functionItem
Config choices
Version 1

Block 12 - More Pages

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 13 - Set More Pages

Type / Role
n8n-nodes-base.function - function
Config choices
Version 1

Block 14 - Set

Type / Role
n8n-nodes-base.set - set
Config choices
Version 1

Block 15 - Generate filename

Type / Role
n8n-nodes-base.functionItem - functionItem
Config choices
Version 1

Block 16 - Read Binary File

Type / Role
n8n-nodes-base.readBinaryFile - readBinaryFile
Config choices
Version 1

Block 17 - File exists?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 18 - Write Binary File

Type / Role
n8n-nodes-base.writeBinaryFile - writeBinaryFile
Config choices
Version 1

Block 19 - Read Binary File1

Type / Role
n8n-nodes-base.readBinaryFile - readBinaryFile
Config choices
Version 1

Block 20 - Wait

Type / Role
n8n-nodes-base.function - function
Config choices
Version 1

Block 21 - Prepare countries

Type / Role
n8n-nodes-base.function - function
Config choices
Version 1

Block 22 - Create Directory

Type / Role
n8n-nodes-base.executeCommand - executeCommand
Config choices
Version 1

Block 23 - MongoDB

Type / Role
n8n-nodes-base.mongoDb - mongoDb
Config choices
Version 1

3. Summary Table

Workflow Scrape and store data from multiple website pages
Complexity advanced
Nodes 23
Categories Engineering
Author Miquel Colomer
Published 07 May 2021

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/1073/1073.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Scrape and store data from multiple website pages do?

This workflow allows extracting data from multiple pages website. The workflow: 1) Starts in a country list at https://www.theswiftcodes.com/browse by country/. 2) Loads every country page (https:/...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering use case.