Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

202
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda