@@ -23,7 +23,7 @@ protected override void MyInit(params string[] arguments)
2323 var word = "可乐|雪碧" ;
2424 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 } } ) ;
2525 AddEntityType < BaiduSearchEntry > ( ) ;
26- AddPipeline ( new MySqlEntityPipeline ( "Database='mysql';Data Source=localhost;User ID=root;Port=3306;SslMode=None; ") ) ;
26+ AddPipeline ( new SqlServerEntityPipeline ( "Server=. \\ SQLEXPRESS;Database=master;Trusted_Connection=True;MultipleActiveResultSets=true ") ) ;
2727 }
2828
2929 [ TableInfo ( "baidu" , "baidu_search_entity_model" ) ]
@@ -45,16 +45,16 @@ class BaiduSearchEntry : BaseEntity
4545 [ ReplaceFormatter ( NewValue = "-" , OldValue = " " ) ]
4646 public string Website { get ; set ; }
4747
48- [ Field ( Expression = ".//div/span/a[@class='c-cache']/@href" ) ]
48+ [ Field ( Expression = ".//div/span/a[@class='c-cache']/@href" , Length = 0 ) ]
4949 public string Snapshot { get ; set ; }
5050
51- [ Field ( Expression = ".//div[@class='c-summary c-row ']" , Option = FieldOptions . InnerText ) ]
51+ [ Field ( Expression = ".//div[@class='c-summary c-row ']" , Option = FieldOptions . InnerText , Length = 0 ) ]
5252 [ ReplaceFormatter ( NewValue = "" , OldValue = "<em>" ) ]
5353 [ ReplaceFormatter ( NewValue = "" , OldValue = "</em>" ) ]
5454 [ ReplaceFormatter ( NewValue = " " , OldValue = " " ) ]
5555 public string Details { get ; set ; }
5656
57- [ Field ( Expression = "." , Option = FieldOptions . InnerText ) ]
57+ [ Field ( Expression = "." , Option = FieldOptions . InnerText , Length = 0 ) ]
5858 [ ReplaceFormatter ( NewValue = "" , OldValue = "<em>" ) ]
5959 [ ReplaceFormatter ( NewValue = "" , OldValue = "</em>" ) ]
6060 [ ReplaceFormatter ( NewValue = " " , OldValue = " " ) ]
0 commit comments