from selenium import webdriver from axe_selenium_python import Axe import gradio as gr def test_url(url): driver = webdriver.Chrome() driver.get(url) axe = Axe(driver) # Inject axe-core javascript into page. axe.inject() # Run axe accessibility checks. results = axe.run() # Write results to file #axe.write_results(results, 'a11y.json') driver.close() # Assert no violations are found #assert len(results["violations"]) == 0, axe.report(results["violations"]) print (results) demo = gr.Interface(fn=test_url, inputs="text", outputs="text", title="Comprobación de accesibilidad") demo.launch()