Code accompanying the publication "Strategies to access web-enabled urban spatial data for socioeconomic research using R functions". Since the introduction of the World Wide Web in the 1990s, available information for research purposes has increased exponentially leading to a significant proliferation of web-based research. Nowadays it is common the use of internet-based databases which are obtained by either primary data online surveys or secondary official and non-official registers. However, information disposal varies depending on data category and country and specifically, the collection of microdata at low geographical level for urban analysis can be a challenge. The most common difficulties when working with secondary web-based data can be grouped into two categories: accessibility and availability problems. Accessibility problems are present when the data publication in the servers blocks or delays the download process, which becomes a tedious reiterative task that can produce errors in the construction of big databases. Availability problems usually arise when the official agencies restrict access to the information for statistical confidentiality reasons. In order to overcome some of these problems, this paper presents different strategies based on URL parsing, PDF text extraction and web scraping. A set of functions, which are available under a GPL-2 license, have been built in the R package specially to extract and organize databases at the municipality level (NUTS 5) in Spain on population, unemployment, vehicle fleet and firm.