mirror of
https://codeberg.org/scip/kleingebaeck.git
synced 2025-12-16 12:01:00 +01:00
fixed changes on kleinanzeigen.de:
- Meta did not contain condition and category together anymore, they removed the category. Therefore fetching (that is, validation) failed. - Now we extract the condition and category directly. - On top, category now includes the whole category tree. - unit tests had to be tweaked for this measure.
This commit is contained in:
@@ -135,12 +135,13 @@ func Scrape(c *Config, uri string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(ad.Meta) == 2 {
|
||||
ad.Category = ad.Meta[0]
|
||||
ad.Condition = ad.Meta[1]
|
||||
|
||||
if len(ad.CategoryTree) > 0 {
|
||||
ad.Category = strings.Join(ad.CategoryTree, " => ")
|
||||
}
|
||||
|
||||
if ad.Incomplete() {
|
||||
slog.Debug("got ad", "ad", ad)
|
||||
return errors.New("could not extract ad data from page, got empty struct")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user