A lightweight Python web scraper that extracts job listings from the Fake Python Jobs demo site and exports them to CSV and HTML.
Built as part of the Roadmap.sh Job Listings Scraper project.
This project demonstrates a simple end-to-end web scraping workflow in Python:
Web page
↓
HTTP request
↓
HTML parsing with BeautifulSoup
↓
Job data extraction
↓
CSV export
↓
HTML report generation
The scraper collects the main information from each job listing and stores it in a structured CSV file. A second script converts that CSV data into a readable HTML table.
- 🌐 Fetch job listings from a public demo website.
- 🔎 Parse HTML with BeautifulSoup4.
- 📋 Extract job title, company, location, and job detail URL.
- 💾 Export results to
jobs.csv. - 📊 Generate a browser-friendly
jobs.htmlreport. - 🔗 Convert job URLs into clickable links.
- 🛡️ Handle missing fields without stopping the extraction process.
- 🪶 Keep the implementation lightweight with minimal dependencies.
| Technology | Purpose |
|---|---|
| Python 3.8+ | Application and data processing |
| Requests | HTTP requests |
| BeautifulSoup4 | HTML parsing and data extraction |
| CSV | Structured data export |
| Pathlib | File handling |
| HTML / CSS | Generated job listings report |
requests, csv, and pathlib are part of the Python standard library. The only external dependency is BeautifulSoup4.
python-job-listings-scraper/
│
├── scraper.py # Scrapes job listings and creates jobs.csv
├── view_jobs_html.py # Converts jobs.csv into jobs.html
└── README.md
The following files are generated when the scripts are executed:
jobs.csv # Scraped job data
jobs.html # HTML report
- Python 3.8 or later
- Internet connection
Install the required dependency:
pip install beautifulsoup4If requests is not available in your Python environment, install it with:
pip install requestsgit clone https://github.com/Serio120/python-job-listings-scraper.git
cd python-job-listings-scraperpython scraper.pyThe script retrieves the job listings and creates:
jobs.csv
Expected output:
Extraction completed. Data saved to jobs.csv
python view_jobs_html.pyThis creates:
jobs.html
Open jobs.html in a web browser to view the extracted listings in a formatted table.
python scraper.py
python view_jobs_html.pyEach job listing contains the following fields:
| Field | Description |
|---|---|
title |
Job title |
company |
Company name |
location |
Job location |
detail_url |
URL of the job detail page |
Missing values are represented as N/A rather than causing the extraction process to fail.
Although intentionally small, this project covers several fundamental concepts that are useful when building data collection tools with Python:
- HTTP requests and response handling.
- HTML document parsing.
- DOM element selection.
- Defensive extraction of optional fields.
- Structured CSV generation.
- Transformation of structured data into HTML.
- Basic file-system operations.
- Separation of data collection from presentation.
This project targets the Fake Python Jobs website provided by Real Python for learning and scraping practice. It is a static demonstration site, so JavaScript rendering is not required.
The scraper is intentionally simple and is not designed as a production-grade crawling system. It does not include features such as pagination, retries, rate limiting, persistent databases, or scheduled execution.
No license is currently specified for this repository.
Learn by building · Scrape · Transform · Explore