Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!