It may not be the best place for that (gha.py would have been better), but it's the shorter / faster way to do it for now. Moreover it now uses logging for writing the group. The logger format has been updated for this to work. This was done to fix issues on GitHub Action logs, where groups were declared after the logs.
18 lines
668 B
Python
18 lines
668 B
Python
from common import dates, endoflife
|
|
from requests_html import HTMLSession
|
|
|
|
"""Fetches Confluence versions from www.atlassian.com.
|
|
|
|
Note that requests_html is used because JavaScript is needed to render the page."""
|
|
|
|
product = endoflife.Product("confluence")
|
|
r = HTMLSession().get("https://www.atlassian.com/software/confluence/download-archives")
|
|
r.html.render(sleep=1, scrolldown=3)
|
|
|
|
for version_block in r.html.find('.versions-list'):
|
|
version = version_block.find('a.product-versions', first=True).attrs['data-version']
|
|
date = dates.parse_date(version_block.find('.release-date', first=True).text)
|
|
product.declare_version(version, date)
|
|
|
|
product.write()
|