A complete Java-based job scraping and analytics application built for Moroccan job portals. This project collects job offers, cleans and enriches data, exports datasets for Weka, and provides both a Swing GUI and a command-line ML workflow.
This repository contains:
- Web scrapers for job portals:
Rekrute,Emploi.ma, andMarocAnnonces - Data cleaning, feature extraction, and category balancing pipeline
- Weka-compatible export for classification and analysis
- A GUI dashboard with login, site selection, job listings, statistics, and ML recommendations
- A CLI-based machine learning engine using J48, Naive Bayes, Random Forest, and k-NN
src/scraping/— web scrapers for Moroccan job sitessrc/processing/— data cleaning and transformation pipelinesrc/ml/— training, evaluation and model persistencesrc/ui/— Swing interface and dashboard applicationsrc/dao/— database access objectslib/— third-party JAR dependenciesmodels/— trained Weka models and saved classifier filesdata/— cleaned dataset examples and ARFF exports
- Scrapes job listings with site-specific parsers
- Normalizes and extracts job attributes from raw text
- Balances label categories for better ML performance
- Generates clean CSV and ARFF files for Weka
- Trains and evaluates multiple classifiers
- Provides job recommendation logic in the GUI
- Supports model saving and loading
- Java 11+ installed
- MySQL server available
- Git clone of this repository
- Required JARs are included in
lib/
The default database connection is configured in src/util/DBConnection.java:
- URL:
jdbc:mysql://localhost:3307/job_scraper - User:
root - Password: `` (empty)
Update the connection parameters if your MySQL server uses a different port, database name, or credentials.
From the repository root:
javac -cp "lib/*" -d bin src\**\*.javajava -cp "bin;lib/*" main.Mainjava -cp "bin;lib/*" ml.MLMainjava -cp "bin;lib/*" processing.RunCompletePipelineFixed- Run
processing.RunCompletePipelineFixedto create cleaned datasets and Weka-ready files. - Open
data/06_weka_ready_fixed.arffin Weka or useml.MLMainto train models. - Use the GUI via
main.Mainfor scraping, job browsing, and recommendations.
The project already contains useful output files such as:
data/01_données_nettoyées.csvdata/06_weka_ready_fixed.arff04_dataset_complet_fixed.csv05_dataset_simplifié_fixed.csv07_guide_weka_fixed.txt
The application depends on the following libraries located in lib/:
weka.jarjsoup-1.21.2.jarmysql-connector-j-9.5.0.jaropencsv-5.9.jarjfreechart,jcommon,orsonpdf,orsoncharts, and others for charts and UI utilities
- The
models/directory is created automatically when saving trained classifiers. - The GUI uses JDBC and requires the MySQL server to be running before launch.
- If you change the database port or credentials, adjust
src/util/DBConnection.javaand the processing scripts accordingly.
Contributions, bug fixes, and improvements are welcome. For major changes, please create a branch and submit a pull request.