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

265
Visualizações
Push data from a websocket / js script via Selenium to python script

I need to read a variable from a js script.

However, the variable gets constantly updated by a websocket pushing new messages to the client.

So each time a message gets pushed from the server to the client the js script processes the data.

Now, I already tried to access the websocket via python websocket client. However, I cannot connect directly. Therefore instead I will need to use Selenium with Chrome to get the data from the websocket.

Now, I am not exactly sure yet how to do this.

But my idea is something like this:

  1. Open the website with Selenium
  2. Modify the javascript file at the point where the websocket message gets processed.
  3. Modify this location by adding something like an event emitter. Ie alter the js script and add a new js codeline at exactly this location.
  4. In my python script listen to this event emitter to capture the value each time a new message gets pushed from the websocket.

My question: is this possible and if so how to do this?

about 4 years ago · Juan Pablo Isaza
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