Answer the question
In order to leave comments, you need to log in
Why doesn't phantomjs parse everything?
There is a site with court cases, from there you need to parse each case. For some reason, the parser is parsing, but not all cases are from the site. The parseTokenJSON function parses JSON in which the token is stored, which is then substituted into the link, parseCaseJSON, this one actually parses by reference.
function parseTokenJSON(link) {
page.open(link, function (status) {
phantom.cookiesEnabled;
phantom.cookies;
data = page.plainText;
json = JSON.parse(data);
token = json['id'];
formTokenLink(token);
});
//page.close();
}
function parseCaseJSON(link) {
// setTimeout( function () {
page.open(link, function (status) {
source = page.plainText;
array = JSON.parse(source);
console.log(currentPage);
console.log(link);
//var article = array.result.data[0].article;
//console.log(article);
//console.log(array.result.data.(0).article);
//console.log(array.result.data);
//var r = JSON.stringify(array, null, 2);
//fs.write(path, r, 'w');
currentPage++;
console.log(JSON.stringify(array, null, 2));
visitSite();
});
//}, 5040);
//page.close();
}
Answer the question
In order to leave comments, you need to log in
Why did you uncover phantomjs to parse api?
Wouldn't it be easier to run node.js with the same script?
"result": null, "finished": false
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question