Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

203
Vistas
How to click a Button automatically with Javascript from Python using Js2py

I am using eel in order to connect the frontent(HTML,CSS and JS) and backend with Python.

I want to click the button element automatically when a if condition states to true in python.

As far as I've searched I came across Js2py to be the easiest yet it doesn't seem to work with button clicking event.

The code that I tried

js='function $fine(){document.getElementById("spl").live("click");}'
ok=js2py.eval_js(js)
ok()

Error that I got:

raise MakeError('ReferenceError', '%s is not defined' % prop) js2py.internals.simplex.JsException: ReferenceError: document is not defined

Note: The if condition that I am checking for is

if not mixer.music.get_busy()

Basically a Music player project using Pygame, the need to click the play button in order to start the next song once the current song has completed playing. I have used eel in order to get functions from python to Javascript but now I want to get Javascript functions to python without using Flask. Any suggestions would be really helpful.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

UPDATE Js2Py Not working hence I tried to solve the same using Eel and faced another error as stated here but managed to solve it by doing as stated here

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda