Skip to content

Instantly share code, notes, and snippets.

@ernestguevarra
Created May 18, 2020 17:26
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 ernestguevarra/6697464c939fa7f8d761256fbb8567c0 to your computer and use it in GitHub Desktop.
Save ernestguevarra/6697464c939fa7f8d761256fbb8567c0 to your computer and use it in GitHub Desktop.
var url = 'https://www.dfa.gov.ph/dfa-news/dfa-releasesupdate?start=1&end=2352';
var fs = require('fs');
var page = require('webpage').create();
page.open(url, function(status) {
if (status === 'success') {
var html = page.evaluate(function() {
return document.documentElement.outerHTML;
});
try {
fs.write("data-raw/dfaPressReleases.txt", html, 'w');
} catch(e) {
console.log(e);
}
}
phantom.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment