blob: 97bc97c6c7a347d97a8ef7346209fe918dc13846 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
casper = require('casper').create()
casper.start("https://facebook.com", function() {
var query;
query = {
email: 'andrew.fenlon@tufts.edu',
pass: '$mnesi42'
};
return this.fill("#login_form", query, true);
});
casper.thenOpen('https://facebook.com/annamalob');
casper.then(function() {
var tryAndScroll;
tryAndScroll = function() {
return casper.waitFor(function() {
casper.scrollToBottom();
return true;
}, function() {
if (!casper.visible('.createdAccountUnit')) {
return tryAndScroll();
}
});
};
return tryAndScroll();
});
casper.then(function() {
var elements;
elements = JSON.stringify(this.getElementsInfo('.userContent'));
return require('fs').write('user_content.json', elements);
});
|