design tweaks
This commit is contained in:
@@ -138,11 +138,13 @@ data:
|
||||
for col in soup.select(".ik.daily-forecast-container .ik.dailyForecastCol")[:15]:
|
||||
dow_el = col.select_one(".ik.dfDay")
|
||||
icon_el = col.select_one("img.ik.forecast-icon")
|
||||
daynum_el = col.select_one(".ik.dfDayNum")
|
||||
|
||||
# Normal structure (most days)
|
||||
tmax_el = col.select_one("div.ik.max")
|
||||
tmin_el = col.select_one("div.ik.min")
|
||||
|
||||
|
||||
daynum = daynum_el.get_text(strip=True) if daynum_el else ""
|
||||
dow = dow_el.get_text(strip=True) if dow_el else ""
|
||||
icon = _abs_url(icon_el.get("src") if icon_el else None)
|
||||
|
||||
@@ -167,6 +169,7 @@ data:
|
||||
if dow and (tmin is not None) and (tmax is not None):
|
||||
daily.append(
|
||||
{
|
||||
"daynum": daynum,
|
||||
"dow": dow, # e.g. "Cs", "P", "Sz"
|
||||
"tmin_c": tmin,
|
||||
"tmax_c": tmax,
|
||||
|
||||
Reference in New Issue
Block a user