How to make simple interacting with running python script for web?
Question: I have a running loop script in Python, which I want interact with a HTML-
page. For example:

> (HTML)Clicking button -> magic -> (Python) Do something function in
> script.py

[This response](http://stackoverflow.com/questions/27474557/interact-with-
python-script-running-infinitive-loop-from-web) is not appropriate for this.


Answer: Probably you can use Selenium python binding for the purpose of interecting
with Web page with your python script.

[Selenium link](http://selenium-python.readthedocs.org/getting-started.html)

Example:

    
    
    from selenium import webdriver
    from selenium.webdriver.common.keys import Keys
    
    driver = webdriver.Firefox()
    driver.get("http://www.python.org")
    assert "Python" in driver.title
    elem = driver.find_element_by_name("q")
    elem.send_keys("pycon")
    elem.send_keys(Keys.RETURN)
    assert "No results found." not in driver.page_source
    driver.close()
    

