-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscraper.js
More file actions
33 lines (31 loc) · 738 Bytes
/
Copy pathscraper.js
File metadata and controls
33 lines (31 loc) · 738 Bytes
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
33
var next = function (i) {
if (i > 0) {
i++;
return 'https://www.brainyquote.com/quotes/authors/a/arnold_schwarzenegger_' + i + '.html';
} else {
return 'https://www.brainyquote.com/quotes/authors/a/arnold_schwarzenegger.html';
}
};
var scraper = {
iterator: 'div.boxyPaddingBig',
data: {
quote: {
sel: 'span.bqQuoteLink a',
method: 'text'
},
author: {
sel: 'div.bq-aut a',
method: 'text'
}
}
};
var params = {
throttle: 1000,
limit: 4,
concat: true,
scrape: scraper,
done: function (data) {
artoo.saveJson(data, {filename: 'quotes.json'})
}
};
artoo.ajaxSpider(next, params);