debug log
This commit is contained in:
parent
2838afc843
commit
fcc6403dbf
@ -55,6 +55,7 @@ public class Kleinanzeigen {
|
|||||||
synchronized (offers) {
|
synchronized (offers) {
|
||||||
removed = _cleanUp();
|
removed = _cleanUp();
|
||||||
objectMapper.writerWithDefaultPrettyPrinter().writeValue(FILE, offers);
|
objectMapper.writerWithDefaultPrettyPrinter().writeValue(FILE, offers);
|
||||||
|
log.debug("Wrote {} offers to file: {}", offers.size(), FILE);
|
||||||
}
|
}
|
||||||
removed.forEach(remove);
|
removed.forEach(remove);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -89,14 +90,14 @@ public class Kleinanzeigen {
|
|||||||
final FetchResult pageFetchResult = fetch(++page);
|
final FetchResult pageFetchResult = fetch(++page);
|
||||||
totalFetchResult.merge(pageFetchResult);
|
totalFetchResult.merge(pageFetchResult);
|
||||||
}
|
}
|
||||||
log.info("FetchResult: {}", totalFetchResult);
|
log.debug("FetchResult: {}", totalFetchResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
private FetchResult fetch(final int page) {
|
private FetchResult fetch(final int page) {
|
||||||
final FetchResult fetchResult = new FetchResult();
|
final FetchResult fetchResult = new FetchResult();
|
||||||
try {
|
try {
|
||||||
final URI uri = getPageURI(page);
|
final URI uri = getPageURI(page);
|
||||||
log.info("Fetching page: {}", uri);
|
log.debug("Fetching page: {}", uri);
|
||||||
final Document document = Jsoup.parse(uri.toURL(), 3000);
|
final Document document = Jsoup.parse(uri.toURL(), 3000);
|
||||||
for (Element article : document.select("li.ad-listitem:not(.is-topad) article.aditem")) {
|
for (Element article : document.select("li.ad-listitem:not(.is-topad) article.aditem")) {
|
||||||
final Offer offer;
|
final Offer offer;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user