Cheerio.gs library For Google App Script or Google Spreadsheet
- First Create a App script File giving any name.
- Copy the Cheerio.gs code and paste on that appscript file.
- Save the file and create another appscript file for web scraping works.
- On that file you can write web scraping code using cheeerio.gs
Example and Method :
//link for scraping
let link = "https://b.codewithsundeep.com"
//fetch the link and get content
let fetch = UrlFetchApp.fetch(link).getContentText();
//cheerio instance
let cheerio = main.cgs();
//load content in cheerio
let $ = cheerio.load(fetch)
Logger.log($("body").text())
Now You Can Use all other cheerio properties and methods following cheerio.js documentation.