FIX: HTML hatte sich geändert (Einheit 'km' wurde aus Entfernungsangabe entfernt)

This commit is contained in:
Patrick Haßel 2025-10-10 15:01:36 +02:00
parent 08cc0e1474
commit 36324f2723

View File

@ -65,7 +65,7 @@ public class OfferCreate {
articleDate = parseDate(article.select(".aditem-main--top--right").text()); articleDate = parseDate(article.select(".aditem-main--top--right").text());
articleURL = uri.resolve(article.select(".aditem-image a").attr("href")).toString(); articleURL = uri.resolve(article.select(".aditem-image a").attr("href")).toString();
final String locationString = article.select(".aditem-main--top--left").text(); final String locationString = article.select(".aditem-main--top--left").text();
final Matcher locationMatcher = Pattern.compile("^(?<zipcode>\\d+) (?<location>.+) \\((:?ca.)?\\s*(?<distance>\\d+(?:[,.]\\d+)?)\\s*km\\s*\\)$").matcher(locationString); final Matcher locationMatcher = Pattern.compile("^(?<zipcode>\\d+) (?<location>.+) \\((:?ca.)?\\s*(?<distance>\\d+(?:[,.]\\d+)?)\\s*(?:km)?\\s*\\)$").matcher(locationString);
if (!locationMatcher.find()) { if (!locationMatcher.find()) {
throw new LocationNotFound(); throw new LocationNotFound();
} }