From 6a0431bd97a67de98cdaa75b53bf2a0005b3cce6 Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Thu, 16 Jul 2020 19:00:26 +0300 Subject: [PATCH] ndl: workaround broken layout on Vulkan Beta downloads page --- tools/nv-driver-locator/get_vulkan_downloads.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/nv-driver-locator/get_vulkan_downloads.py b/tools/nv-driver-locator/get_vulkan_downloads.py index be0a508..3ad1fc0 100755 --- a/tools/nv-driver-locator/get_vulkan_downloads.py +++ b/tools/nv-driver-locator/get_vulkan_downloads.py @@ -55,10 +55,10 @@ def get_drivers(*, timeout=10): body = fetch_url(URL) soup = BeautifulSoup(body, 'html.parser') result = [] - for sibling in soup.find('h4', - string=re.compile(r'Vulkan .* Developer Beta Driver Downloads', re.I) - ).next_siblings: - if sibling.name == 'h4': + section_start = soup.find('h4', string=re.compile(r'Vulkan Beta Driver Downloads', re.I)) + section_end = section_start.find_next("h4") + for sibling in section_start.find_all_next(): + if sibling is section_end: break if sibling.name == 'p' and sibling.b is not None: m = re.match(r'(Windows|Linux)\s+((\d+\.){1,2}\d+)', sibling.b.string)