Application to get live USD/INR rate Using Python
In this article, we are going to write a python scripts to get live information of USD/INR rate and bind with it GUI application.
- bs4: Beautiful Soup is a Python library for pulling data out of HTML and XML files.
pip install bs4
- requests: This module allows you to send HTTP/1.1 requests very easily.
pip install requests
- Extract data from the given URL. Copy the URL, after selecting the desired location.
- Scrape the data with the help of requests and the Beautiful Soup module.
- Convert that data into HTML code.
- Find the required details and filter them.
Step 1: Import all the modules required.
Step 2: Create a URL get function
Step 3: Now pass the URL into the getdata() function and convert that data(currency details) into HTML code.
The URL used here is https://finance.yahoo.com/quote/usdinr=X?ltr=1
Step 4: Filter the currency details and quality(increment/decrement) according to the given data.
'73.2610-0.2790 (-0.38%)As of 3:30PM BST. Market open.'
Below is the complete program implemented using tkinter module.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course