-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
30 lines (27 loc) · 855 Bytes
/
test.js
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
'use strict';
var peruse = require('./peruse');
console.log('Setting up Scraper...');
var siteData = {
// get auctions currently listed.
'baseUrl': 'http://www.ebay.com/sch/m.html?_nkw=&_armrs=1&_from=&_ssn=',
'postfix': '&_ipg=200&rt=nc',
'selector': [
{
'title': '.ittl',
'url': {
'selector': '.ittl > h3 > a',
'type': 'href'
},
'photo': {
'selector': '.picW img',
'type': 'src'
}
}
]
};
var scraper = new peruse(siteData, {verbose: true, 'identifier': 'rockmusicnerd'});
console.log('calling process()');
scraper.process(function(data) {
console.log('DONE ' + data.length);
console.log(JSON.stringify(data));
});