Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d533ce2

Browse files
committed
项目 bugfix
1 parent 8c60bc8 commit d533ce2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/logic/project.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ func (self ProjectLogic) ParseProjectList(pUrl string) error {
225225
pUrl = "http://" + pUrl
226226
}
227227

228-
logger.Infoln("parse project url:", pUrl)
229-
230228
var (
231229
doc *goquery.Document
232230
err error
@@ -238,24 +236,24 @@ func (self ProjectLogic) ParseProjectList(pUrl string) error {
238236
}
239237

240238
// 最后面的先入库处理
241-
projectsSelection := doc.Find(".news-list .box")
239+
projectsSelection := doc.Find(".news-list").Children()
242240

243241
for i := projectsSelection.Length() - 1; i >= 0; i-- {
244242

245243
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")
247245

248246
if !ok || projectUrl == "" {
249247
logger.Errorln("project url is empty")
250248
continue
251249
}
252-
go func() {
250+
go func(projectUrl string) {
253251
err := self.ParseOneProject(projectUrl)
254252

255253
if err != nil {
256254
logger.Errorln(err)
257255
}
258-
}()
256+
}(projectUrl)
259257
}
260258

261259
return err

0 commit comments

Comments
 (0)