On 12 November, CETAPS Digital Lab hosted the workshop “Web Scraping with R” at the Faculty of Arts and Humanities of the University of Porto (FLUP), which I facilitated. The workshop introduced participants to the basics of web scraping with R and the rvest package, exploring how publicly available information on the internet can be collected and transformed into structured data for further analysis and visualisation.

The workshop was designed as an introduction to both R and to collecting information from websites using RStudio. Its main learning goals were:
- Understanding the basic principles of web scraping and its potential applications in Humanities research;
- Identifying and extracting specific HTML elements using CSS selectors;
- Learning how to retrieve information from websites using R and the rvest package;
- Collecting information from multiple entries and organising it into structured datasets;
- Saving the collected information in a CSV file for subsequent analysis.
Beyond the technical aspects, we also wanted participants to reflect on additional considerations involved in web scraping. Researchers should first consider whether web scraping is necessary, taking into account the time and effort required to develop a scraping script and whether the website offers an API. They must also take into account the website terms of use and any restrictions specified in robots.txt files.
The workshop was organised around the CETAPS Repository's Fiction bridges Science in Anglo-Portuguese Contexts collection. This provided a practical example of a structured online collection containing information that could be retrieved and organised for research purposes. If you are interested in exploring this database, you can download it without scraping by simply creating a CETAPS repository account.
Throughout the workshop, the emphasis was on understanding the underlying process rather than simply running a pre-written script. Participants were encouraged to comprehend how individual instructions contribute to the final dataset.

Ultimately, the workshop aimed to demonstrate how relatively simple programming techniques can open up new possibilities for research in the Humanities. Web scraping allows researchers to collect and organise publicly available online information in ways that can support new research questions and analytical approaches. At the same time, it requires a critical understanding of the sources, technical limitations and ethical considerations involved in the process.
By introducing participants to R and Rvest, we hoped to provide them with a starting point to explore these possibilities independently and to incorporate reproducible data collection methods into their own research.