Scrape Any Website in N8N - Top 4 Methods

Whoever is trying to scrape data with n8n has into this: when trying to use an HTTP request to collect web data, and we either can’t get it to work, or it breaks after 10 requests. Blocking, site changes, and scalability are all big issues with this approach.

Fortunately, there are better ways. Over my years of experience in n8n projects, here is the approach I take when I need to collect and use web data:

1 - Look for official APIs when available

So often people want to scrape, when there’s a better, and official way. An API, unlike a website, is intended for automated data collection. So you’ll waste a lot less time with this approach.

If you want to see how to integrate any tool’s REST API into n8n, that doesn’t have a node, I made a step by step video: https://youtu.be/mMEX4Zsz4XY

2 - Find pre-built scrapers on the Apify Store

The store has pre-built scrapers for thousands of websites, so you get a clean table or JSON of data based on your input. You pay per result with usually a free tier, and it’s as easy as adding the Apify node into your n8n flow:

Here you can set the input data of the specific actor you’re running, take the output, process it and save it in any way you want with n8n.

3 - General-purpose Scrapers with AI parsing

If a pre-built scraper is not available, use a general scraper such as:

1 - Webpage to Markdown by Apify (used with the Apify node)
2 - Firecrawl (also has a community node)

Which post-return results in an AI-friendly way only including the website text and formatting.

Then, you can connect these to an AI node in n8n with a budget-friendly LLM (such as OpenAI’s nano models) to extract the data. This is also useful if the website(s) you’re scraping have a different structure each time.

4 - Custom development with open-source libraries

If you are, or working with, Python or Javascript developers, and the scale or special requirements of the project require it, there are some great open-source libraries for scraping which manage a lot of the complexity in the background. However, the development time and cost will still be significant. So these are more useful for larger projects. These are the best libraries in my experince:

  • Python: Scrapy
  • Javascript: Crawlee

Both of these can manage large websites with queues, retries, long runs, and custom databases to save the output data.

Want to work with me?
If you have an automation or AI project, I can jump in for consulting and implementation, depending on your needs.
Book a free consulting call: Book a Call - SmoothWork
FInd my on Youtube: https://youtube.com/@vasarmilan

1個讚

There’s also a community node called customJS that also allows webscraping too

Good overview. One thing worth adding on the Apify route: for actors that run longer than 5 minutes, skip run-sync and go async instead — trigger the run, store the runId, then poll the dataset endpoint. Avoids timeout issues completely.

Yes that’s a good point, thank you!

Great overview. Particularly, I fully agree that in case when there is an official API, one should prefer it in any circumstances, as it is usually more reliable and less prone to breaking down in comparison with HTML scraping. In case when there is no such possibility, use of dedicated scraping instruments and browsers will be a better choice than simple HTTP request to all sites.
I would like to mention one more thing – do not forget about post-processing of the obtained information, i.e. data cleaning, deduplication, validation and structuring, which are essential for SEO, competition analysis and content generation in particular.
For those who wants to automate SEO work based on scraped data, RazorGrowth is an example.