diff --git a/.gitignore b/.gitignore index 2791b77..daa1151 100644 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,7 @@ dmypy.json # Pyre type checker .pyre/ + + +# Jetbrains IDE +.idea/ \ No newline at end of file diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/changelog.py b/src/changelog.py index 936e3de..d7a1bd7 100644 --- a/src/changelog.py +++ b/src/changelog.py @@ -15,8 +15,8 @@ def __init__(self, url): page = urlopen(url) # parse the html using beautiful soup and store in variable `soup` soup = BeautifulSoup(page, 'html.parser') - mainPage = soup.find('h2', text='Release notes') - self.PageData = mainPage.parent + mainPage = soup.find('h2', text='Release Notes') + self.PageData = mainPage.parent.find('div', attrs={'class': 'release-notes'}) diff --git a/src/constants.py b/src/constants.py index 8b54e76..af17e2c 100644 --- a/src/constants.py +++ b/src/constants.py @@ -1,3 +1,3 @@ -UNITY_ROOT = 'https://unity3d.com' -PAGE_PREFIX_PATH = UNITY_ROOT + '/unity/whats-new' +UNITY_ROOT = 'https://unity.com' +PAGE_PREFIX_PATH = UNITY_ROOT + '/releases/editor/whats-new' diff --git a/src/util.py b/src/util.py index 6eba27d..ec12874 100644 --- a/src/util.py +++ b/src/util.py @@ -6,14 +6,20 @@ from bs4 import BeautifulSoup def loadUnityVersions(): - base_search_page = PAGE_PREFIX_PATH + '/unity-5.6.0' + base_search_page = PAGE_PREFIX_PATH + '/5.6.0' page = urlopen(base_search_page) # parse the html using beautiful soup and store in variable `soup` soup = BeautifulSoup(page, 'html.parser') # Take out the
of name and get its value mainPage = soup.find('div', attrs={'class': 'full-release'}) + if mainPage is None: + print('Did not find div, probably unity website structure changed') + mainPage = soup.find('div', attrs={'class': 'releases-item-list'}) versionDropdown = mainPage.find('ul', attrs={'class': 'options'}) + if versionDropdown is None: + versionDropdown = mainPage.find('ul') + entries = versionDropdown.findAll('a')