Skip to content

Commit 754f6d6

Browse files
authored
Update CP parsing for new format (#27)
1 parent 4c8bd39 commit 754f6d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scrapers/ScrapeAdventurer.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func ScrapeAdventurer(region string, profileTarget string) (profile models.Profi
3737
}
3838
})
3939

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

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

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

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

0 commit comments

Comments
 (0)