@@ -21,7 +21,7 @@ protected override void OnInit(params string[] arguments)
21
21
var word = "可乐|雪碧" ;
22
22
AddStartUrl ( string . Format ( "http://news.baidu.com/ns?word={0}&tn=news&from=news&cl=2&pn=0&rn=20&ct=1" , word ) , new Dictionary < string , dynamic > { { "Keyword" , word } } ) ;
23
23
AddEntityType < BaiduSearchEntry > ( ) ;
24
- AddPipeline ( new SqlServerEntityPipeline ( "Server=. \\ SQLEXPRESS;Database=master;Trusted_Connection=True;MultipleActiveResultSets=true ") ) ;
24
+ AddPipeline ( new MySqlEntityPipeline ( "Database='mysql';Data Source=localhost;User ID=root;Port=3306;SslMode=None; ") ) ;
25
25
}
26
26
27
27
[ TableInfo ( "baidu" , "baidu_search_entity_model" ) ]
@@ -43,16 +43,16 @@ class BaiduSearchEntry : BaseEntity
43
43
[ ReplaceFormatter ( NewValue = "-" , OldValue = " " ) ]
44
44
public string Website { get ; set ; }
45
45
46
- [ FieldSelector ( Expression = ".//div/span/a[@class='c-cache']/@href" , Length = 0 ) ]
46
+ [ FieldSelector ( Expression = ".//div/span/a[@class='c-cache']/@href" ) ]
47
47
public string Snapshot { get ; set ; }
48
48
49
- [ FieldSelector ( Expression = ".//div[@class='c-summary c-row ']" , Option = FieldOptions . InnerText , Length = 0 ) ]
49
+ [ FieldSelector ( Expression = ".//div[@class='c-summary c-row ']" , Option = FieldOptions . InnerText ) ]
50
50
[ ReplaceFormatter ( NewValue = "" , OldValue = "<em>" ) ]
51
51
[ ReplaceFormatter ( NewValue = "" , OldValue = "</em>" ) ]
52
52
[ ReplaceFormatter ( NewValue = " " , OldValue = " " ) ]
53
53
public string Details { get ; set ; }
54
54
55
- [ FieldSelector ( Expression = "." , Option = FieldOptions . InnerText , Length = 0 ) ]
55
+ [ FieldSelector ( Expression = "." , Option = FieldOptions . InnerText ) ]
56
56
[ ReplaceFormatter ( NewValue = "" , OldValue = "<em>" ) ]
57
57
[ ReplaceFormatter ( NewValue = "" , OldValue = "</em>" ) ]
58
58
[ ReplaceFormatter ( NewValue = " " , OldValue = " " ) ]
0 commit comments