title: Push data from a websocket / js script via Selenium to python script
body: <p>I need to read a variable from a js script.</p>
  <p>However, the variable gets constantly updated by a websocket pushing new messages to the client.</p>
  <p>So each time a message gets pushed from the server to the client the js script processes the data.</p>
  <p>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.</p>
  <p>Now, I am not exactly sure yet how to do this.</p>
  <p>But my idea is something like this:</p>
  <ol>
  <li>Open the website with Selenium</li>
  <li>Modify the javascript file at the point where the websocket message gets processed.</li>
  <li>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.</li>
  <li>In my python script listen to this event emitter to capture the value each time a new message gets pushed from the websocket.</li>
  </ol>
  <p>My question: is this possible and if so how to do this?</p>