From 3dd5eda8dca54946762cbe926d7142118d5eae7e Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Sun, 27 Apr 2025 19:46:55 +0200 Subject: [PATCH] [veeam] Enable column name customization This is required for https://github.com/endoflife-date/endoflife.date/pull/6614. --- src/veeam.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/veeam.py b/src/veeam.py index 1eed3cfa..b778433d 100644 --- a/src/veeam.py +++ b/src/veeam.py @@ -1,3 +1,4 @@ +import logging import re import sys @@ -17,13 +18,17 @@ for config in endoflife.list_configs(p_filter, "veeam", m_filter): response = http.fetch_url(config.url) soup = BeautifulSoup(response.text, features="html5lib") + version_column = config.data.get("version_column", "Build Number").lower() + date_column = config.data.get("date_column", "Release Date").lower() for table in soup.find_all("table"): headers = [header.get_text().strip().lower() for header in table.find("tr").find_all("td")] - if "build number" not in headers or "release date" not in headers: + if version_column not in headers or date_column not in headers: + logging.warning("Skipping table with headers %s as it does not contains '%s' or '%s'", + headers, version_column, date_column) continue - version_index = headers.index("build number") - date_index = headers.index("release date") + version_index = headers.index(version_column) + date_index = headers.index(date_column) for row in table.find_all("tr")[1:]: cells = row.find_all("td") if len(cells) <= max(version_index, date_index):