mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 03:56:37 +00:00
Add sample scraping/automation example via Phantomjs
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
13
sample-functions/Phantomjs/feedly_subscribers.js
Normal file
13
sample-functions/Phantomjs/feedly_subscribers.js
Normal file
@ -0,0 +1,13 @@
|
||||
var webPage = require('webpage');
|
||||
var page = webPage.create();
|
||||
|
||||
var feed = "http://blog.alexellis.io/rss/";
|
||||
var url = "https://feedly.com/i/subscription/feed/" + feed;
|
||||
|
||||
page.open(url, function(status) {
|
||||
var title = page.evaluate(function(s) {
|
||||
return document.querySelector(s).innerText;
|
||||
}, ".count-followers");
|
||||
console.log(title.split(" ")[0]);
|
||||
phantom.exit();
|
||||
});
|
Reference in New Issue
Block a user