Skip to content

Instantly share code, notes, and snippets.

@jbarber jbarber/chrome.js
Created Nov 26, 2016

Embed
What would you like to do?
PhantomJS 2.1.1 snippet for getting versions of $LATEST chrome installers
var page = require('webpage').create();
page.open('https://enterprise.google.com/chrome/chrome-browser/', function(status) {
console.log("Status: " + status);
if(status === "success") {
var winVer = page.evaluate(function() {
return document.querySelector("#download span[ng-bind='win64Version']").innerHTML;
});
var macVer = page.evaluate(function() {
return document.querySelector("#download span[ng-bind='macVersion']").innerHTML;
});
var button = page.evaluate(function() {
return document.querySelector("#download div.button.chrome");
});
console.log("wget -O " + winVer + ".exe https://dl.google.com/chrome/install/googlechromestandaloneenterprise64.msi");
console.log("wget -O " + macVer + ".dmg https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg");
}
phantom.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.