Beispiel #1
0
def fetch_json_data(_browser: WebDriver):
    output = _browser.execute_async_script(get_process_script(), 'get_ersttermin_json')
    write_file('ersttermin.json', output)

    output = _browser.execute_async_script(get_process_script(), 'get_vaccination_list_json')
    write_file('vaccination-list.json', output)

    output = _browser.execute_async_script(get_process_script(), 'get_version')
    write_file('version.txt', output)
    async def fetch_large_image_from_lodestone_url(cls, driver: WebDriver, url: str) -> bytes:
        print(f'Scraping lodestone url: {url}')
        driver.get(url)

        WebDriverWait(driver, ANGLER_PAGE_LOAD_WAIT_DURATION).until(
            expected_conditions.presence_of_element_located(
                (By.CSS_SELECTOR, '.db-view__item__icon__item_image.sys_nq_element')
            )
        )

        img_data_url: str = driver.execute_async_script(fetch_large_url_data_from_lodestone_page)
        return base64.b64decode(img_data_url.split(',')[1])