This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cheerio = require('cheerio'); | |
const fs = require('fs-extra'); | |
const got = require('got'); | |
const writeStream = fs.createWriteStream('quote.csv'); | |
async function init() { | |
const url = 'https://quotes.toscrape.com'; | |
const response = await got(url); | |
const $ = cheerio.load(response.body); | |
writeStream.write('quote,author,tags\n'); |
NewerOlder