#!/usr/bin/env python3 """ Dit script is enkel en alleen bedoeld om heel veel willekeurige pagina's te kunnen testen en enkel degene eruit te halen die falen (en dus niet correct afgehandeld worden). """ from scraper import run antwoord = run('en', 'Special:Random', 'Philosophy') langste = antwoord while 'pad' in antwoord or antwoord['error'].startswith('Cyclus'): if 'error' not in antwoord and len(langste['pad']) < len(antwoord['pad']): langste = antwoord print(f"Langste pad (lengte {len(langste['pad'])}), van {langste['pad'][0]} naar {langste['pad'][-1]}") antwoord = run('en', 'Special:Random', 'Philosophy') print('Er ging iets mis:', antwoord['error'])