Web Scraping

You can use the Cheerio library and Axios HTTP request library for building accesible web scraping with Make.

Example 1: Parsing HTML content

Input:

{
  "content": "<h2 class='title'>Hello World</h2>"
}

JavaScript Code:

// Load cheerio library for server-side HTML parsing
const cheerio = require('cheerio');

// Parse the HTML content from input
const $ = cheerio.load(input.content);

// Extract text from h2 element with class 'title'
return $("h2.title").text();

Output:

{
  "output": "Hello World"
}
Make.com Custom JavaScript Web Scraping Example
Make.com Custom JavaScript Web Scraping Example

Example 2: Scraping a website

Input:

{
  "url": "https://www.google.com/"
}

JavaScript Code:

const axios = require('axios');
const cheerio = require('cheerio');

const response = await axios.get(input.url);
const $ = cheerio.load(response.data);
return $("head title").text();

Output:

{
  "output": "Google"
}
Make.com Custom JavaScript Web Scraping Example
Make.com Custom JavaScript Web Scraping Example