Wikipedia search app using Flask Framework - Python Last Updated : 14 May, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report Flask is a micro web framework written in Python. It is classified as a micro-framework because it does not require particular tools or libraries. Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. Installation: 1) In order to create the flask app we have to first install the flask. pip install flask 2) In order to extract the data from Wikipedia, we must first install the Python Wikipedia library. pip install wikipedia Create a flask app: 3) Create a file and name it as app.py 4) Create the templates folder to store all the html files. Folder structure: How to create wikipedia search app using Flask Framework? Now, let's start coding the application Create the file - app.py Python3 # import necessary libraries from flask import Flask, request, render_template import wikipedia app = Flask(__name__) # create HOME View @app.route("/", methods=["POST", "GET"]) def home(): if request.method == "GET": return render_template("index.html") else: search = request.form["search"] # Fetch data from wikipedia result = wikipedia.summary(search, sentences=2) return f"<h1>{result}</h1>" if __name__ == '__main__': app.run(debug=True) Create a file index.html that will be used by flask - HTML <!DOCTYPE html> <html> <head> <title>Wikipedia Search</title> </head> <body> <form method="post"> <input type="text" name="search"> <br> <button type="submit">Search</button> </form> </body> </html> Output: If we search INDIA in this input tag then the output is: Comment More infoAdvertise with us Next Article How to Build a Web App using Flask and SQLite in Python V vivekpisal12345 Follow Improve Article Tags : Python Python Flask Flask Projects Practice Tags : python Similar Reads Wikipedia search app Project using Django Django is a high-level Python based Web Framework that allows rapid development and clean, pragmatic design. It is also called batteries included framework because Django provides built-in features for everything including Django Admin Interface, default database â SQLlite3, etc. Today we will creat 3 min read Todo list app using Flask | Python There are many frameworks that allow building your webpage using Python, like Django, flask, etc. Flask is a web application framework written in Python. Flask is based on WSGI(Web Server Gateway Interface) toolkit and Jinja2 template engine. Its modules and libraries that help the developer to writ 3 min read Create a Weather app using Flask | Python Prerequisite : Flask installation Flask is a lightweight framework written in Python. It is lightweight because it does not require particular tools or libraries and allow rapid web development. today we will create a weather app using flask as a web framework. this weather web app will provide curr 2 min read Story Generator App Using Python In the realm of programming and natural language processing, there's an opportunity to create engaging and creative applications that spark the imagination. One such project is the development of a Story Generator App using Python. In this article, we'll embark on a journey to understand how to buil 4 min read How to Build a Web App using Flask and SQLite in Python Flask is a lightweight Python web framework with minimal dependencies. It lets you build applications using Python libraries as needed. In this article, we'll create a Flask app that takes user input through a form and displays it on another page using SQLite.Run the following commands to install Fl 3 min read Python | Build a REST API using Flask Prerequisite: Introduction to Rest API REST stands for REpresentational State Transfer and is an architectural style used in modern web development. It defines a set or rules/constraints for a web application to send and receive data. In this article, we will build a REST API in Python using the Fla 3 min read Like