Skip to content

Instantly share code, notes, and snippets.

@jbarber
Created November 26, 2016 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbarber/86a8f09e88a7f530ef55ee690ff75233 to your computer and use it in GitHub Desktop.
Save jbarber/86a8f09e88a7f530ef55ee690ff75233 to your computer and use it in GitHub Desktop.
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