title: Python selenium - Call python method from javascript
body: <p>Is it possible to call a python method from javascript in selenium.</p>
  <p>I am looking something like QWebChannel in PyQt5.</p>
  <p>I found how can i run javascript from python. Example:</p>
  <pre class="lang-py prettyprint-override"><code>driver = webdriver.Chrome(executable_path=&quot;C:\\chromedriver.exe&quot;)
  driver.implicitly_wait(0.5)
  driver.get(&quot;https://www.tutorialspoint.com/tutor_connect/index.php&quot;)
  # to scroll till page bottom
  driver.execute_script(&quot;window.scrollTo(0,document.body.scrollHeight);&quot;)
  </code></pre>
  <p>But i am looking from the oposite: when a javascript event is fired or a javascript function is end then call a python method.</p>