1
Fork 0
This repository has been archived on 2025-06-02. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2022ST-project-Phikipathia/cgi-bin/stresstest.py
2022-05-19 19:45:43 +02:00

19 lines
693 B
Python

#!/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'])