Skip to content

Commit

Permalink
Ajout d'un "custom converter" pour éviter que les dates soient conver…
Browse files Browse the repository at this point in the history
…tie en prennant compte le timezone du serveur. (spring-projects/spring-data-mongodb#3482)
  • Loading branch information
twanou committed Mar 17, 2024
1 parent 92dd761 commit 091b1d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ public class Deputy implements UuidDocument {
String firstName;
String lastName;
String title;
String lastDistrict;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import quebec.salonbleu.assnat.scrapers.configuration.AssNatWebClient;
import quebec.salonbleu.assnat.scrapers.exceptions.ScrapingException;
import quebec.salonbleu.assnat.scrapers.models.ScrapedDeputy;
import quebec.salonbleu.assnat.utils.ErrorHandler;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.htmlunit.html.DomElement;
Expand All @@ -17,6 +13,10 @@
import org.htmlunit.html.HtmlTableDataCell;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import quebec.salonbleu.assnat.scrapers.configuration.AssNatWebClient;
import quebec.salonbleu.assnat.scrapers.exceptions.ScrapingException;
import quebec.salonbleu.assnat.scrapers.models.ScrapedDeputy;
import quebec.salonbleu.assnat.utils.ErrorHandler;

import java.io.InputStream;
import java.util.ArrayList;
Expand Down Expand Up @@ -59,8 +59,8 @@ public List<ScrapedDeputy> scrape() {
.title(this.getTitle(functions))
.firstName(StringUtils.strip(cells.get(0).getVisibleText().split(",")[1]))
.lastName(StringUtils.strip(cells.get(0).getVisibleText().split(",")[0]))
.district(cells.get(1).getVisibleText())
.party(this.independenceCheck(party) ? INDEPENDENT_PARTY : party)
.district(StringUtils.strip(cells.get(1).getVisibleText()))
.party(this.independenceCheck(party) ? INDEPENDENT_PARTY : StringUtils.strip(party))
.partyAcronym(this.independenceCheck(party) ? INDEPENDENT_ACRONYM : this.getPartyAcronym(party))
.functions(functions)
.photo(this.getPhotoBase64(deputyPage))
Expand Down

0 comments on commit 091b1d9

Please sign in to comment.