mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 12:06:37 +00:00
Add sample scraping/automation example via Phantomjs
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
10
sample-functions/Phantomjs/cnn.js
Normal file
10
sample-functions/Phantomjs/cnn.js
Normal file
@ -0,0 +1,10 @@
|
||||
var webPage = require('webpage');
|
||||
var page = webPage.create();
|
||||
|
||||
page.open('https://www.cnn.com/', function(status) {
|
||||
console.log('Status: ' + status);
|
||||
console.log(page.title);
|
||||
// Do other things here...
|
||||
phantom.exit();
|
||||
|
||||
});
|
Reference in New Issue
Block a user