0% found this document useful (0 votes)
14 views1 page

Py

The document contains a Python script that uses Selenium to automate the process of retrieving exam results for students based on their hall ticket numbers from a specified website. It reads hall ticket numbers from an Excel file, submits them along with a captcha, and extracts the marks for eight subjects, calculating the average. Finally, it saves the results to a new Excel file and prints a completion message.

Uploaded by

Tech- 420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Py

The document contains a Python script that uses Selenium to automate the process of retrieving exam results for students based on their hall ticket numbers from a specified website. It reads hall ticket numbers from an Excel file, submits them along with a captcha, and extracts the marks for eight subjects, calculating the average. Finally, it saves the results to a new Excel file and prints a completion message.

Uploaded by

Tech- 420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

from selenium import webdriver

from selenium.webdriver.common.by import By


from selenium.webdriver.common.keys import Keys
import pandas as pd
import time

# Load hall ticket numbers


tickets = pd.read_excel('hall_tickets.xlsx')['HallTicket'].tolist()

driver = webdriver.Chrome()

results = []
for ticket in tickets:
driver.get('https://vignan.ac.in/vuresultsr22/default.asp?
exam=BTECH_R22C22_2YEAR_2SEM_REG_April_2025')
time.sleep(1)

driver.find_element(By.NAME, 'hallticket').send_keys(str(ticket))
captcha = driver.find_element(By.ID, 'captchaField') # adjust ID
captcha_text = captcha.get_attribute('value')
captcha.send_keys(captcha_text)

driver.find_element(By.XPATH, '//input[@value="Submit"]').click()
time.sleep(2)

# Extract marks of 8 subjects


marks = [int(td.text) for td in driver.find_elements(By.CSS_SELECTOR, '.mark-
cell')]
average = sum(marks) / len(marks) if marks else None

results.append({
'HallTicket': ticket,
**{f'Subject{i+1}': marks[i] for i in range(8)},
'Average': average
})

driver.quit()

# Save results
pd.DataFrame(results).to_excel('student_results.xlsx', index=False)
print("Done!")

You might also like