I'm trying to get data from a live score site. I am using node.js with express.js, request.js and cheerio.js to get the HTML from a web page. It works for some parts of the HTML, but not the live parts.
I'm trying to scrape data from the web site http://www.flashresultats.com. When I use the Chrome Developer Tools I'm able to see the HTML content, but when I use my JavaScript code, the result is empty.
Here is the Chrome capture of what I am trying to extract:
And here is the code I am using:
var express = require('express');
var fs = require('fs');
var request = require('request');
var cheerio = require('cheerio');
var app = express();
url = 'http://www.flashresultats.fr'
request(url, function(error, response, html){
if(!error){
var $ = cheerio.load(html);
var myvar = $('#g_1_UJzOgxfc').html();
console.log(myvar);
}
else {
console.log('Error');
}
})