I'm trying to get Google's "People also search for" content on the search results page and I'm using PhantomJS to scrape their results. However, that Knowledgebase part I need does not show up in the body
I get. Does anyone know what I could do to have it shown to me?
Here's the code:
var phantom = require('phantom');
phantom.create(function (ph) {
ph.createPage(function (page) {
page.open("http://www.google.com/ncr", function (status) {
console.log("opened google NCR ", status);
page.evaluate(function () { return document.title; }, function (result) {
console.log('Page title is ' + result);
page.open("https://www.google.com/search?gws_rd=ssl&site=&source=hp&q=google&oq=google", function (status) {
console.log("opened google Search Results ", status);
page.evaluate(function () { return document.body; }, function (result) {
console.log(result);
ph.exit();
});
});
});
});
});
});
PS I have to first request `google.com/ncr' to force-load Google.Com's results as I'm based in Germany and the German version does not have the knowledge graph. Maybe the requests above can also be simplified...