Skip to content

Commit

Permalink
Update CP parsing for new format (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
man90es authored Aug 29, 2024
1 parent 4c8bd39 commit 754f6d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scrapers/ScrapeAdventurer.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func ScrapeAdventurer(region string, profileTarget string) (profile models.Profi
}
})

c.OnHTML(`.desc.guild span`, func(e *colly.HTMLElement) {
c.OnHTML(`.line_list li:nth-child(1) .desc span`, func(e *colly.HTMLElement) {
guildStatus := e.Text

if region != "EU" && region != "NA" {
Expand All @@ -49,12 +49,12 @@ func ScrapeAdventurer(region string, profileTarget string) (profile models.Profi
}
})

c.OnHTML(`.line_list .desc:not(.guild)`, func(e *colly.HTMLElement) {
c.OnHTML(`.line_list li:nth-child(2) .desc`, func(e *colly.HTMLElement) {
createdOn := utils.ParseDate(e.Text)
profile.CreatedOn = &createdOn
})

c.OnHTML(`.character_desc_area .character_info span:nth-child(3) em`, func(e *colly.HTMLElement) {
c.OnHTML(`.line_list li:nth-child(3) .desc`, func(e *colly.HTMLElement) {
if contributionPoints, err := strconv.Atoi(e.Text); err == nil {
profile.ContributionPoints = uint16(contributionPoints)
} else {
Expand Down

0 comments on commit 754f6d6

Please sign in to comment.