Scrape and Store Data from Multiple Website Pages
This workflow allows extracting data from multiple pages of a website. The workflow: 1) Starts on 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 on 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 the `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 the n8n local disk. If I relaunch the workflow, we check if a cache file exists to discard non-required requests to the webpage. If the data present on the website changes, you can apply a Cron node to check the website once per week. Finally, before inserting data into MongoDB, the best way to avoid duplicates is to check that the 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.
This workflow allows extracting data from multiple pages of a website.
The workflow:
- Starts on a country list at https://www.theswiftcodes.com/browse-by-country/.
- Loads every country page (https://www.theswiftcodes.com/albania/).
- Paginates every page on the country page.
- Extracts data from the country page.
- Saves data to MongoDB.
- Paginates through all pages in all countries.
It uses the 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 the n8n local disk. If I relaunch the workflow, we check if a cache file exists to discard non-required requests to the webpage.
If the data present on the website changes, you can apply a Cron node to check the website once per week.
Finally, before inserting data into MongoDB, the best way to avoid duplicates is to check that the 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.
New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.
Part of a bundle
Web Scraping & Research Engine
This workflow is one of 8 in the bundle — $59.00 for all of them.
That is $7.38 each, vs $14.99 for this one alone.
View bundleSecure checkout powered by Stripe
Support
How to import this workflow into n8n
- 1Purchase or download the workflow to get the n8n workflow JSON file.
- 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
- 3Open each node marked with a credential warning and connect your own accounts and API keys.
- 4Run the workflow once manually to verify the data flow, then toggle it to Active.
Related Data & Analytics workflows
- Generate AI viral videos with VEO 3 and upload to TikTok$14.99
- Generate a daily multi-asset market report with TwelveData, Groq and Google Sheets$14.99
- Build an OpenAI RAG system with document upload, semantic search and caching$24.99
- Automate Website Content Scraping and SEO Keyword Extraction with GPT-4o-mini and Airtable$14.99
- Process Contact Form Submissions with Validation and MongoDB Storage$14.99
- Add webhook data to a Google Sheet$2.99
More from Miquel Colomer
Need this deployed? We'll set it up for you.
Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.