diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-04-29 15:21:11 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-04-29 15:21:11 -0700 |
| commit | c0d7d730143824f86474172ea4c226372b00e464 (patch) | |
| tree | 62ace59d5e804de109e690bd0955a51bad342512 /bemani | |
| parent | 1f6231ef399702c4ec0ff76b13455b00af23f91b (diff) | |
pc: urljoin with eamuse base url
Diffstat (limited to 'bemani')
| -rw-r--r-- | bemani/polaris_chord.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bemani/polaris_chord.py b/bemani/polaris_chord.py index a025d83..3b13236 100644 --- a/bemani/polaris_chord.py +++ b/bemani/polaris_chord.py @@ -1,6 +1,7 @@ from bs4 import BeautifulSoup from datetime import datetime import pytz +from urllib.parse import urljoin import re CATEGORY_MAP = { @@ -12,6 +13,7 @@ CATEGORY_MAP = { def parse_polaris_chord_news_site(html: str) -> list[dict]: + base_url = "https://p.eagate.573.jp/" soup = BeautifulSoup(html, 'html.parser') news_list = [] for li in soup.select('#info-news li.news'): @@ -37,7 +39,7 @@ def parse_polaris_chord_news_site(html: str) -> list[dict]: content = detail.get_text().strip() first_a = detail.find('a', href=True) - url = first_a['href'] if first_a else None + url = urljoin(base_url, first_a['href']) if first_a else None images = [] for img in detail.find_all('img'): |
