Magnetic Ink Character Recognition using Python Last Updated : 17 May, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report Magnetic Ink Character Recognition or MICR which is generally used in a bank. This is a 9 digit code to identify the location of the bank branch. MICR code is a code printed on cheques using MICR (Magnetic Ink Character Recognition technology). This enables identification of the cheques and which in turns means faster processing. In this article, we are going to write a python script to validate the MICR code and extract information. Modules neededbs4: Beautiful Soup(bs4) is a Python library for pulling data out of HTML and XML files. This module does not come built-in with Python. To install this type the below command in the terminal.pip install bs4 requests: Requests allows you to send HTTP/1.1 requests extremely easily. This module also does not comes built-in with Python. To install this type the below command in the terminal.pip install requests Approach: Import moduleMerge MICR Code into URLMake requests instance and pass into URLPass the requests into a Beautifulsoup() functiontraverse the information MICR code into soup object Implementation: Python3 # import module import requests from bs4 import BeautifulSoup # link for extract html data # Making a GET request def getdata(url): r = requests.get(url) return r.text # input by geek # MICR code Micr = "800002012" # url url = "https://micr.bankifsccode.com/"+Micr # pass the url # into getdata function htmldata = getdata(url) soup = BeautifulSoup(htmldata, 'html.parser') # traverse the bank information data = [] for i in (soup.find_all("div", class_="text6")): data.append((i.get_text())) # Validate the # data if len(data) == 0: print("Not Valid MICR Code") else: print("Found") print(data) Output: Found ['MICR Code:- 800002012, STATE BANK OF INDIA, DIGHA'] Comment More infoAdvertise with us Next Article How To Print Unicode Character In Python? K kumar_satyam Follow Improve Article Tags : Python python-utility Python-projects Web-scraping Python web-scraping-exercises +1 More Practice Tags : python Similar Reads How to Recognize Optical Characters in Images in Python? Prerequisite: Pytesseract, OpenCV In this article, we are going to recognize the character from the images and get text data out of an image. Let's take a quick introduction to the required module. OpenCV: It is a Python module in which we can do image processing, video capture, and some analysis to 2 min read Python | Reading contents of PDF using OCR (Optical Character Recognition) Python is widely used for analyzing the data but the data need not be in the required format always. In such cases, we convert that format (like PDF or JPG, etc.) to the text format, in order to analyze the data in a better way. Python offers many libraries to do this task. There are several ways of 6 min read How To Print Unicode Character In Python? Unicode characters play a crucial role in handling diverse text and symbols in Python programming. This article will guide you through the process of printing Unicode characters in Python, showcasing five simple and effective methods to enhance your ability to work with a wide range of characters Pr 2 min read Image Transformations using OpenCV in Python In this tutorial, we are going to learn Image Transformation using the OpenCV module in Python. What is Image Transformation? Image Transformation involves the transformation of image data in order to retrieve information from the image or preprocess the image for further usage. In this tutorial we 5 min read How to create Word Art from an image using Python? In this article, we are going to learn how to create word art from an image using Python. In this, we are going to take an image as input and then created a similar image in a text form using the characters. We can perform this task with the help of pillow and pywhatkit modules of Python. Pillow Thi 2 min read How To Encode And Decode A Message using Python? Encryption is the process of converting a normal message (plain text) into a meaningless message (Ciphertext). Whereas, Decryption is the process of converting a meaningless message (Cipher text) into its original form (Plain text). In this article, we will take forward the idea of encryption and de 3 min read Like