A simple project combining web scraping in pure Python utilizing BeautifulSoup and requests. This project also includes a presentation layer built in the Django framework.
-
Scraper (Python + BeautifulSoup):
- Extracts current job listings from the target website.
- Audit Logging: Utilizes the built-in
loggingmodule to track script execution, record data extraction events, and log potential connection errors (which it outputs toscraper.log). - Error Resilience: Implements
try-exceptblocks to handle unexpected issues or changes without crashing. - Exports clean, structured data to a
jobs.jsonfile.
-
Web Viewer (Django):
- A lightweight Django application acting purely as a presentation layer (View + Template).
- Automatically reads and formats data from the scraped JSON file.
- Features UI built with simple HTML/CSS.
1. Clone the repository and install dependencies:
git clone https://github.com/MSZM0/Job-Scraper.git
cd Job-Scraper
pip install django requests beautifulsoup42. Run the scraper (Optional):
You can run the scraper to download the latest data, but a jobs.json file is also provided for demonstration purposes.
python scraper.py3. Start the Django server: To view the data in your browser, start the local development server:
python manage.py runserverFinally, open your web browser and navigate to http://127.0.0.1:8000/.