title: printing an output of javascript in a webpage using selenium and python
body: <p>I was making an python program that executes a java script after loading a <a href="https://html5.haxball.com/headless" rel="nofollow noreferrer">webpage</a> it is a web based api where we can execute javascript commands through console of your browser (f12) ( api <a href="https://github.com/haxball/haxball-issues/wiki/Headless-Host" rel="nofollow noreferrer">documentation</a>)
  <br/>This executing gives back an array, I just want to get this output of execution (the array) to be print. the code i used is given below. the time delay of 15 seconds is used for solving an captcha which have to do manually.
   executing <code>getPlayerList();</code> command will give back you a list of players that is currently playing.</p>
  
  <pre><code>from selenium import webdriver
  import time
  import os
  driver=webdriver.Firefox()
  driver.get("https://html5.haxball.com/headless")
  time.sleep(5)
  driver.execute_script("""
  window.room = window.HBInit({ roomName: 'botts', maxPlayers: 16 });
  """)
  #the time dalay is to solve the captcha manually that appear on the browser after executing above javascript.
  time.sleep(15)
  print(driver.execute_script(""" 
  console.log(window.getPlayerList();
  """))
  </code></pre>
  
  <p>The above program works fine, but i have to print the output of <code>getPlayerList();</code> I tried with <code>return</code> and <code>console log</code>, but that is not working for me.</p>