Skip to content

Commit

Permalink
fixed issue #258
Browse files Browse the repository at this point in the history
  • Loading branch information
jakopako committed Nov 28, 2023
1 parent 7fb78ed commit 645d254
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scraper/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,6 @@ func getTextString(e *ElementLocation, s *goquery.Selection) (string, error) {
}
fieldStrings[i] = fieldString
}
// automatically trimming whitespaces might be confusing in some cases...
for i, f := range fieldStrings {
fieldStrings[i] = strings.TrimSpace(f)
}
// regex extract
for i, f := range fieldStrings {
fieldString, err := extractStringRegex(&e.RegexExtract, f)
Expand All @@ -844,6 +840,11 @@ func getTextString(e *ElementLocation, s *goquery.Selection) (string, error) {
}
fieldStrings[i] = fieldString
}
// automatically trimming whitespaces might be confusing in some cases...
// TODO make this configurable
for i, f := range fieldStrings {
fieldStrings[i] = strings.TrimSpace(f)
}
// shortening
for i, f := range fieldStrings {
fieldStrings[i] = utils.ShortenString(f, e.MaxLength)
Expand Down

0 comments on commit 645d254

Please sign in to comment.