File tree 3 files changed +8
-2
lines changed
3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ if (program.scraperdir) {
118
118
}
119
119
if ( program . scraper ) {
120
120
var definition = fs . readFileSync ( program . scraper ) ;
121
- var scraper = new Scraper ( definition ) ;
121
+ var scraper = new Scraper ( JSON . parse ( definition ) ) ;
122
122
if ( ! scraper . valid ) {
123
123
scraper . on ( 'definitionError' , function ( problems ) {
124
124
log . error ( 'the scraper provided was not valid for the following reason(s):' ) ;
Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ var mapping = {
32
32
[ scraper , 'element capture failed' ] ,
33
33
'scraper.elementResults' :
34
34
[ scraper , 'element results' ] ,
35
+ 'scraper.selectorFailed' :
36
+ [ scraper , 'selector had no results' ] ,
37
+ 'scraper.attributeFailed' :
38
+ [ scraper , 'attribute was not valid' ] ,
35
39
'scrapersLoaded' :
36
40
[ scraperBox , 'scrapers loaded' ] ,
37
41
'gettingScraper' :
@@ -53,6 +57,8 @@ module.exports.getlevel = function(event) {
53
57
return 'data' ;
54
58
} else if ( / e l e m e n t R e s u l t s / . test ( event ) ) {
55
59
return 'debug' ;
60
+ } else if ( / F a i l e d / . test ( event ) ) {
61
+ return 'debug' ;
56
62
}
57
63
return 'info' ;
58
64
}
Original file line number Diff line number Diff line change 34
34
"chalk" : " ~1.0.0" ,
35
35
"commander" : " ~2.7.1" ,
36
36
"moment" : " ~2.10.2" ,
37
- "thresher" : " ^0.1.8 " ,
37
+ "thresher" : " ^0.1.9 " ,
38
38
"which" : " ~1.0.5" ,
39
39
"winston" : " ~1.0.0"
40
40
},
You can’t perform that action at this time.
0 commit comments