diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-18 12:51:55 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-18 12:51:55 +0900 |
| commit | 272f7d079cbac81c9af86b9f210ace8cabc0e98c (patch) | |
| tree | b1489cfe1628ded107d02839ebaed53b551211ef /app/scrapers/pitbar-nishiogikubo.ts | |
| parent | 243d222c35f4607ac13a400e827333f44a0f44c7 (diff) | |
Fix HTML entity leakage in FAD scraper and Pitbar _clone date bug
fad-yokohama: replace innerHTML manipulation with Cheerio .clone().text()
so that HTML entities ( etc.) are decoded before storing titles.
pitbar-nishiogikubo: strip non-numeric suffix from day part of element ID
to handle _clone-suffixed IDs that freecalend.com generates after JS renders.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'app/scrapers/pitbar-nishiogikubo.ts')
| -rw-r--r-- | app/scrapers/pitbar-nishiogikubo.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/scrapers/pitbar-nishiogikubo.ts b/app/scrapers/pitbar-nishiogikubo.ts index 2553002..569ce26 100644 --- a/app/scrapers/pitbar-nishiogikubo.ts +++ b/app/scrapers/pitbar-nishiogikubo.ts @@ -38,10 +38,10 @@ async function extractEvents(page: Page, dateFrom: string, dateTo: string): Prom return Array.from(cells).map((el) => { const id = el.getAttribute("id") ?? ""; const parts = id.split("-"); - // id: cal-25771-YYYY-M-D + // id: cal-25771-YYYY-M-D (sometimes suffixed with _clone after JS cloning) const year = parts[2]; const month = parts[3]; - const day = parts[4]; + const day = parts[4]?.replace(/\D.*$/, ""); if (!year || !month || !day) return null; return { date: `${year}-${month.padStart(2, "0")}-${day.padStart(2, "0")}`, |
