title: How to execute a python script with selenium called by php through apache server?
body: <p>I want to execute the following script in Python through my site in local apache server:</p>
  
  <pre><code>#!/Python34/python
  from selenium import webdriver 
  driver=webdriver.Firefox()
  driver.get("C:\wamp64\www\desenvol\index.html")
  elem1 = driver.find_element_by_link_text("call another page")
  elem1.click()
  </code></pre>
  
  <p>The apache is rightly configured and this is the page that I'm using with the php code:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Light Controller&lt;/title&gt;
  &lt;/head&gt;
  
  
  &lt;?php
  if (isset($_POST['LightON']))
  {
  exec('python hello.py');
  echo("on");
  }
  ?&gt;
  
  &lt;form method="post"&gt;
  &lt;button name="LightON"&gt;Light ON&lt;/button&gt;&amp;nbsp;
  &lt;/form&gt; 
  
  
  &lt;/html&gt;
  </code></pre>