Files
endoflife-date-release-data/src/confluence.py
Marc Wrobel 9cf243a10e Fix scripts requiring rendering pages with javascript (#310)
Replace request_html by playwright, as request_html, as it is [not maintained anymore](https://pypi.org/project/requests-html/) and scripts using it, such as artifactory.py, started to fail.
2024-02-16 23:13:42 +01:00

16 lines
708 B
Python

from bs4 import BeautifulSoup
from common import dates, http, releasedata
"""Fetches Confluence versions from www.atlassian.com.
Note that requests_html is used because JavaScript is needed to render the page."""
with releasedata.ProductData("confluence") as product_data:
content = http.fetch_javascript_url("https://www.atlassian.com/software/confluence/download-archives")
soup = BeautifulSoup(content, 'html.parser')
for version_block in soup.select('.versions-list'):
version = version_block.select_one('a.product-versions').attrs['data-version']
date = dates.parse_date(version_block.select_one('.release-date').text)
product_data.declare_version(version, date)