Feature/extend selector handling of scraper for more use cases (#5047)

* Extend selector handling for more use cases

* Update changelog
pull/5048/head
Thomas Kaul 11 months ago committed by GitHub
parent 4983b7ca12
commit 3fcd611e29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Extended the selector handling of the scraper configuration for more use cases
- Changed `node main` to `exec node main` in the `entrypoint.sh` file to improve the container signal handling
- Improved the language localization for Catalan (`ca`)
- Improved the language localization for Dutch (`nl`)

@ -303,9 +303,21 @@ export class ManualService implements DataProviderInterface {
} catch {}
}
let value = $(scraperConfiguration.selector).first().text();
const lines = value?.split('\n') ?? [];
const lineWithDigits = lines.find((line) => {
return /\d/.test(line);
});
if (lineWithDigits) {
value = lineWithDigits;
}
return extractNumberFromString({
locale,
value: $(scraperConfiguration.selector).first().text()
value
});
}
}

Loading…
Cancel
Save