Skip to content
Related Articles

Related Articles

Improve Article

Check CBSE result using Selenium in Python

  • Last Updated : 04 Jan, 2021

Prerequisite: Selenium Python

In this article, we will scrape the CBSE result from their website and store the result in a CSV file. The CSV file will contain the following information.

  1. Candidate name
  2. Pass or fail status
  3. Marks obtained

Installations required 

  • Go to command prompt and put this is in:
pip install selenium


  1. First to go 12th website follow this LINK(this is for CBSE board 12th result 2014 pass-out).
  2. Then click on investigate element by urgent ctrl + shift + I or stepping into setting of browser and clicking on investigate detail manually.
  3. Then navigate to the box where the roll number is filled then copy the x_path.
  4. Then navigate the view submit button then copy the x_path.
  5. We want to store the result in CSV file then also navigate student name, fail-pass status, marks obtained and then fill up roll number automatically by script go to next page find x_path of student name, fail-pass status, obtain marks.

Given some screenshot to follow this instruction step by step:

Step 1:

Step 2:

Step 3:

Step 4:

Step 5:

Step 6:

follow same left three subject

Below is the implementation:


from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from import Select
from selenium.common.exceptions import NoSuchElementException
import csv
import time
# creating csv file
filename = "cbse.csv"
# open csv file to write
f = open(filename, 'w')
# creat header in file
header = "NAME,STATUS,NUM\n"
# put range of rollnumber
for i in range(9639428, 9639432):
    # use try and exception because if any
    # rollnumber is invalid then whole
    # program is not stop.
        driver = webdriver.Chrome()
        # link is given above copy and paste
        # put rollnumber
        # view result xpath
        # student name
        name = driver.find_element_by_xpath(
        # status pass or fail
        status = driver.find_element_by_xpath(
        # first subject find xpath then next 4 subject
        m1 = driver.find_element_by_xpath(
        m2 = driver.find_element_by_xpath(
        m3 = driver.find_element_by_xpath(
        m4 = driver.find_element_by_xpath(
        m5 = driver.find_element_by_xpath(
        # sum all marks
        num = str(int(m1)+int(m2)+int(m3)+int(m4)+int(m5))
        # all details fill into file
    except NoSuchElementException as exception:


 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

My Personal Notes arrow_drop_up
Recommended Articles
Page :