File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -225,8 +225,6 @@ func (self ProjectLogic) ParseProjectList(pUrl string) error {
225
225
pUrl = "http://" + pUrl
226
226
}
227
227
228
- logger .Infoln ("parse project url:" , pUrl )
229
-
230
228
var (
231
229
doc * goquery.Document
232
230
err error
@@ -238,24 +236,24 @@ func (self ProjectLogic) ParseProjectList(pUrl string) error {
238
236
}
239
237
240
238
// 最后面的先入库处理
241
- projectsSelection := doc .Find (".news-list .box" )
239
+ projectsSelection := doc .Find (".news-list" ). Children ( )
242
240
243
241
for i := projectsSelection .Length () - 1 ; i >= 0 ; i -- {
244
242
245
243
contentSelection := goquery .NewDocumentFromNode (projectsSelection .Get (i )).Selection
246
- projectUrl , ok := contentSelection .Find (".box-aw a" ).Attr ("href" )
244
+ projectUrl , ok := contentSelection .Find (".box-aw a" ).First (). Attr ("href" )
247
245
248
246
if ! ok || projectUrl == "" {
249
247
logger .Errorln ("project url is empty" )
250
248
continue
251
249
}
252
- go func () {
250
+ go func (projectUrl string ) {
253
251
err := self .ParseOneProject (projectUrl )
254
252
255
253
if err != nil {
256
254
logger .Errorln (err )
257
255
}
258
- }()
256
+ }(projectUrl )
259
257
}
260
258
261
259
return err
You can’t perform that action at this time.
0 commit comments