import weasyprint, time time.sleep(30) try: weasyprint.HTML('https://cv.gregandev.fr').write_pdf('out.pdf') except: break