Skip to content

Instantly share code, notes, and snippets.

@saasindustries
Last active January 14, 2021 14:41
Show Gist options
  • Save saasindustries/ffa9011844eba639c4ec456c37a262fd to your computer and use it in GitHub Desktop.
Save saasindustries/ffa9011844eba639c4ec456c37a262fd to your computer and use it in GitHub Desktop.
const axios = require('axios');
const cheerio = require('cheerio');
//performing a GET request
axios.get('https://www.forextradingbig.com/instaforex-broker-review/')
.then(response => {
//handling the success
const html = response.data;
//loading response data into a Cheerio instance
const $ = cheerio.load(html);
//selecting the elements with the data
const scrapedata = $('a', '.comment-bubble').text();
//outputting the scraped data
console.log(scrapedata);
})
.catch( error => {
console.log(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment