How to program this functionality?
For such a task, Python on the server is not needed, a fairly fixed page with the html <form> element is given out using any http-server, and a bit of javascript is allowed to execute requests to google, yandex (if these services have an open search API at all).
If you want exactly Python on the server, then absolutely any web-framework is suitable , for example, using bottle (not tested):
#!/usr/bin/env python from bottle import route, request, template # $ wget http://bottlepy.org/bottle.py @route('/', ['GET', 'POST']) def index(): query = request.forms.get('query') return template(''' <form action="/" method="post"> Query: <input name="query" type="text" /> <input value="Search" type="submit" /> </form> %if results <table> <tr> <td>{{query}}</td> % for count in results: <td>{{count}}</td> % end %end ''', query=query, results=make_requests(query)) run()
where the make_requests() function makes requests and returns the number of pages for each service (for example, as a tuple: make_requests = lambda query: (10, 20) ).
The code is presented only to illustrate the effort required: it does not demonstrate best practices and may not be accurate in details.