Skip to content

Commit f7b4734

Browse files
committed
there exists two tipes of dashes lol
1 parent fe3f451 commit f7b4734

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scraper/src/scraper/scraper_impl.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ type ScraperImpl struct {
1515
Collector *colly.Collector
1616
}
1717

18+
// CleanPrice implements Scraper.
1819
// CleanPrice implements Scraper.
1920
func (s *ScraperImpl) CleanPrice(price string) ([]int, error) {
2021
cleaned := strings.ReplaceAll(price, "$", "")
2122
cleaned = strings.ReplaceAll(cleaned, ".", "")
23+
cleaned = strings.TrimSpace(cleaned) // Limpieza adicional
2224

23-
if strings.Contains(cleaned, "-") {
24-
priceParts := strings.Split(cleaned, "-")
25+
if strings.Contains(cleaned, "\u2013") {
26+
priceParts := strings.Split(cleaned, "\u2013")
2527
var prices []int
2628
for _, part := range priceParts {
2729
part = strings.TrimSpace(part)

0 commit comments

Comments
 (0)