![]() |
VOOZH | about |
In this article, we will learn how to build a Flask-based web application that retrieves and displays summaries from Wikipedia based on user input.
Install flask using the following pip command:
pip install flask
In order to extract the data from Wikipedia, we need Python's Wikipedia library. Install it using:
pip install wikipedia
Create a file named "app.py", this will be our main file and also create a templates folder to store all the html files.
Directory Structure:
👁 ImageAdd this code in app.py:
Explanation:
Create a file index.html inside the templates folder and add the following code that provides frontend interface for user interaction:
Output:
👁 ImageIf we search INDIA in this input tag then the output is:
👁 ImageCode Explanation: