Check 12th Class Result Using Selenium in Python Last Updated : 25 Jan, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report We are going to collect the data of 12th class in CSV file with the following information: Candidate namePass or fail statusDivisionObtain marks This task will be done by using selenium library of Python. Requirement: You need to install chrome driver and set path. Click here To download. For more information follow this link. Approach: First to go 12th website follow this LINK(this is for up board 12th result).Then click on investigate element by urgent ctrl + shift + i or stepping into setting of browser and clicking on investigate detail manually.Then navigate to the box where the district is select then copy the x_path.Then navigate to the box where the roll number is filled then copy the x_path.Then navigate the view result button then copy the x_path.I want to store the result in CSV file then also navigate student name, fail-pass status, division, obtain marks. Then fill up roll number automatically by script go to next page find x_path of student name, fail-pass status, division, obtain marks. Follow step-by-step with the help of screenshots and copy the x_path of element and put into the code: Step 1: Step 2: Step 3: Step 4: Step 5: Step 6: Step 7: Step 8: Step 9: Step 10: Step 11: Step 12: Below is the implementation: Python3 # import required libraries from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException import csv import time # give name of csv file filename = "abc.csv" # open file in write mode f = open(filename, 'w') # create header in file header = "NAME,STATUS,DIV,NUM\n" # write into the file f.write(header) # put rollnumber without zero like # your number 0477593 then # put 477593 upto XXXXX. start_rollNum = 926840 end_rollNum = 926841 # put range of rollnumber for i in range(start_rollNum, end_rollNum ): # use try and except because if any rollnumber # is invalid then whole program is not stop. try: driver = webdriver.Chrome() # link is given above copy and paste driver.get("https://results.upmsp.edu.in/ResultIntermediate.aspx") # add zero in rollnumber in starting t = '0' + str(i) # district xpath state = driver.find_element_by_xpath('//*[@id="ctl00_cphBody_ddl_districtCode"]') drp1 = Select(state) # select district drp1.select_by_visible_text('LUCKNOW') # put rollnumber driver.find_element_by_xpath('//*[@id="ctl00_cphBody_txt_RollNumber"]').send_keys(t) # view result xpath driver.find_element_by_xpath('//*[@id="ctl00_cphBody_btnSubmit"]').click() # student name name = driver.find_element_by_xpath('//*[@id="ctl00_cphBody_lbl_C_NAME"]').text # status pass or fail status = driver.find_element_by_xpath('//*[@id="ctl00_cphBody_lbl_RESULT"]').text # division div = driver.find_element_by_xpath('//*[@id="ctl00_cphBody_lbl_DIVISION"]').text # obatin marks num = driver.find_element_by_xpath('//*[@id="ctl00_cphBody_lbl_MRK_OBT"]').text # all details fill into csv file f.write(name + "," + status + "," + div[1 : ] + "," + num + "\n") # close the driver driver.close() except NoSuchElementException as exception: continue # close and save the file f.close() Output: CSV file screenshot Note: If you Want to find a topper then apply a filter on CSV file. Comment More infoAdvertise with us Next Article How to Locate Elements using Selenium Python? P praveeny182 Follow Improve Article Tags : Python Python-selenium Python Selenium-Exercises Practice Tags : python Similar Reads Check CBSE result using Selenium in Python 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. Candidate namePass or fail statusMarks obtainedInstallations required Go to command prompt and put this is in:pip 2 min read Check High School Result using Selenium in Python We are going to study check high school result status pass or fail by using selenium. This is very useful for schools because when they check how many student pass-fail and what is the name of a fail student. If the student amount is 10 and less than 10 then check easily by manual when if the number 3 min read Locating single elements in Selenium Python Locators Strategies in Selenium Python are methods that are used to locate elements from the page and perform an operation on the same. Seleniumâs Python Module is built to perform automated testing with Python. Selenium Python bindings provide a simple API to write functional/acceptance tests using 5 min read How to Locate Elements using Selenium Python? Selenium: is an open-source tool that automates web browsers. It provides a single interface that lets you write test scripts in programming languages like Ruby, Java, NodeJS, PHP, Perl, Python, and C#, among others. I personally prefer Python as itâs very easy to write code in python. A browser-dri 3 min read How to scrape multiple pages using Selenium in Python? As we know, selenium is a web-based automation tool that helps us to automate browsers. Selenium is an Open-Source testing tool which means we can easily download it from the internet and use it. With the help of Selenium, we can also scrap the data from the webpages. Here, In this article, we are g 4 min read Navigating links using get method - Selenium Python Selenium's Python module allows you to automate web testing using Python. The Selenium Python bindings provide a straightforward API to write functional and acceptance tests with Selenium WebDriver. Through this API, you can easily access all WebDriver features in a user-friendly way. This article e 2 min read Like