Created
May 18, 2020 17:26
-
-
Save ernestguevarra/6697464c939fa7f8d761256fbb8567c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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