A structured data extraction project focused on collecting driving theory exam questions and answers from Spain’s DGT exams. It helps developers and educators build realistic practice tests, learning platforms, and exam simulators using reliable, well-organized data.
Created by Bitbash, built to showcase our approach to Scraping and Automation!
If you are looking for preguntas-de-examen-dgt you've just found your team — Let’s Chat. 👆👆
This project extracts and structures theoretical driving exam questions, including answers and related media, into a clean and reusable dataset. It solves the problem of manually collecting and normalizing exam-style questions for educational or analytical use. It is built for developers, ed-tech teams, and data analysts working on driving test preparation tools.
- Collects full question statements with optional images
- Preserves answer options with correctness flags
- Outputs consistent, schema-validated records
- Designed for repeatable and auditable data runs
| Feature | Description |
|---|---|
| Structured Questions | Captures complete question text with unique local identifiers. |
| Answer Mapping | Associates each question with multiple answers and correctness flags. |
| Image Support | Includes HTTPS image URLs when a question has visual content. |
| Clean Output | Produces normalized JSON suitable for databases or APIs. |
| Educational Focus | Optimized for test simulators and learning platforms. |
| Field Name | Field Description |
|---|---|
| id | Internal numeric identifier unique within a dataset run. |
| idPreguntaCuest | Identifier of the question within its exam context. |
| enunciado | Full text of the exam question. |
| urlImagen | HTTPS URL of the associated image, if available. |
| respuestas | Array of possible answers for the question. |
| respuestas.id | Local identifier for the answer option. |
| respuestas.idPregunta | Reference to the parent question ID. |
| respuestas.contenido | Text content of the answer option. |
| respuestas.correcta | Boolean indicating whether the answer is correct. |
[
{
"id": 1,
"urlImagen": "https://sedeclave.dgt.gob.es/EXAM/WEB_AUTO6/IMAGENES/20_VEHICULOS_PARTES/ESPEJOS/MT45390.jpg",
"enunciado": "Los turismos, ¿están obligados a llevar espejo retrovisor izquierdo?",
"idPreguntaCuest": 1,
"respuestas": [
{
"id": 1,
"idPregunta": 1,
"contenido": "No, es opcional.",
"correcta": false
},
{
"id": 2,
"idPregunta": 1,
"contenido": "Sí, es obligatorio.",
"correcta": true
},
{
"id": 3,
"idPregunta": 1,
"contenido": "Solo si el retrovisor interior no permite una visión completa de la vía.",
"correcta": false
}
]
}
]
Preguntas de Examen DGT/
├── src/
│ ├── main.js
│ ├── extractors/
│ │ ├── questionParser.js
│ │ └── answerParser.js
│ ├── validators/
│ │ └── schemaValidator.js
│ └── utils/
│ └── normalizeText.js
├── data/
│ ├── sample-output.json
│ └── inputs.example.json
├── package.json
└── README.md
- Ed-tech platforms use it to build realistic driving test simulators, so learners can practice with authentic questions.
- Mobile app developers use it to populate quiz apps, enabling faster content creation.
- Data analysts use it to study question patterns and answer distributions in driving exams.
- Training centers use it to generate mock exams tailored to student needs.
Is this an official data source? No. This project is not affiliated with or endorsed by any official authority. It is intended for educational and practice purposes only.
Are the IDs globally unique? IDs are unique within a single dataset run. For long-term tracking, combine the dataset identifier with the question text.
Can the output be used in databases or APIs? Yes. The normalized JSON structure is suitable for direct database ingestion or API responses.
Does every question include an image? No. Image URLs are included only when the original question contains visual content.
Primary Metric: Processes hundreds of questions per minute with consistent field coverage.
Reliability Metric: Over 99% successful question-answer mappings in repeated runs.
Efficiency Metric: Lightweight parsing logic keeps memory usage low during large batches.
Quality Metric: High data completeness with full question text and validated answer correctness.
