K
K
krll-k2016-03-11 22:51:32
JavaScript
krll-k, 2016-03-11 22:51:32

How to parse a page on which data is generated using javascript using nodejs?

I admit that the whole point is that wordstats uses some kind of counter. Used this code:

var request = require("request"),
    cheerio = require("cheerio"),
    url = "https://wordstat.yandex.ru/#!/?db=mobile&words=domru";

request(url, function (error, response, body) {
    if (!error) {
        var $ = cheerio.load(body);

        console.log($(".b-word-statistics__info").html());
    } else {
        console.log("Произошла ошибка: " + error);
    }
});

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Cyrilca, 2016-03-15
@Cyrilca

Look towards PhantomJS .

V
Vitaly, 2019-10-31
@vshvydky

forget the phantom, look towards the puppeteer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question