This project is a web application that automates the process of searching for a case on the Delhi High Court website, extracts key details and related orders, and generates a downloadable PDF report. The application uses a Flask backend to handle user requests, scrape the data, and create the reports, while a simple HTML frontend provides a user-friendly interface.
Note: The current version of extractor.py
uses mock data for demonstration purposes and does not perform live web scraping.
- Case Search: Search for a specific case using its type, number, and year.
- Data Extraction: Parses HTML to extract key case details and links to official orders.
- PDF Generation: Compiles the extracted information into a downloadable PDF report.
- Web Interface: A responsive and easy-to-use frontend for inputting search criteria and viewing results.
- Backend: Python (with Flask)
- Web Scraping: BeautifulSoup (Playwright is set up for future implementation)
- PDF Generation: FPDF
- Frontend: HTML, CSS, JavaScript
Before you begin, ensure you have the following installed:
- Python 3.x
pip
(Python package installer)
-
Clone the repository:
git clone <your-repository-url> cd H_COURT_DEL
-
Create and activate a virtual environment (recommended):
python -m venv .venv source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`
-
Install Python dependencies:
pip install Flask beautifulsoup4 fpdf playwright
-
Install Playwright browser binaries: (This is required for the intended web scraping functionality)
playwright install
/H_COURT_DEL
├── app.py # Main Flask application
├── extractor.py # Data extraction and PDF generation logic
├── templates/
│ └── app.html # Frontend HTML, CSS, and JavaScript
├── .gitignore
├── LICENSE
└── README.md
-
Run the Flask application:
python app.py
The server will start on
http://127.0.0.1:8080
. -
Open the web browser: Navigate to
http://127.0.0.1:8080
in your web browser. -
Perform a search:
- Fill out the form with a Case Type, Case Number, and Year.
- Click the "Search" button.
- The results will be displayed on the page, and a link to download the PDF report will appear.
The submit_case_search
function in extractor.py
is currently a mock. It returns hardcoded HTML and does not perform a live search on the Delhi High Court website. To implement live web scraping, you will need to replace the mock function with your own Playwright logic.