An R script that prepares batch lookups in Spanish public telephone directories by surname. It scrapes a list of Bulgarian surnames, adds their feminine forms, scrapes the ABCtelefonos index pages of six regions and writes both to numbered text files that you then search by hand.
Originally written during the early days of COVID-19 (2020) and released publicly in 2025.
- Two directory services -- builds ABCtelefonos index URLs for each region; the Guiatel/Infobel URL builder is present but commented out, so those files hold only surnames.
- Gender-aware surname variants -- generates feminine forms for surnames following Slavic naming conventions (appending
-ato surnames ending in-v). - Batch file generation -- splits the lists into numbered batch files for manual querying.
- Multi-region coverage -- targets six Spanish provinces/regions in a single run: Zaragoza, Murcia, Granada, Asturias, Almería and Albacete.
- Web scraping -- extracts the surname list and the directory indexes with
rvest.
You need R with tidyverse, rvest and stringi. Clone the repo, edit the write_lines() paths in search.R (they point at a Windows Google Drive folder) and create the three setwd() folders (~/Cuarentena/Almeria, ~/Cuarentena/Albacete, ~/Cuarentena/Granada) or edit those lines, then in R:
install.packages(c("tidyverse", "rvest", "stringi"))
source("search.R")What the script writes and its limits: Usage.
- Usage: dependencies, what the script writes, regions and sources, and its limitations.
This tool queries publicly available telephone directory services. It is provided strictly for educational and research purposes. Users are responsible for complying with all applicable laws and the terms of service of the queried platforms. The author assumes no liability for misuse.
Automated scraping of directory services may violate their terms of service. Use responsibly and at your own risk.