Collecting Data from the Web: Foundation of Webscraping

Book Now
BOOK NOW
a black-and-white photograph of students working together in a design studio with maps and models. A large teal ampersand featuring an illustration of Ada Lovelace is placed on the left. The logo of the Centre for Data, Culture & Society (DCS) appears in the top right corner.

 

In Person 

This course introduces the fundamentals of scraping user-generated content from the web using R or Python, taught over two 2-hour sessions. The first session focuses on the legal and ethical dimensions of web scraping, including questions around terms of service, copyright, privacy, consent, and the boundary between public and private data. We will also look at controversial research cases, consider why they were problematic, and reflect on what responsible web scraping might look like in practice. Alongside these discussions, participants will receive a short introduction to HTML structures and the tools available for scraping in R and Python. The second session will be hands-on, working through the process of scraping a selected static website step by step, before concluding with a discussion of the limitations of scraping and the challenges posed by more complex dynamic sites. 

 

This course will be taught by Aybukee Atalay and Ponrawee Prasertsom 

 

After taking part in this event, you may decide that you need some further help in applying what you have learnt to your research. If so, you can book a Data Surgery meeting with one of our training fellows.  

More details about Data Surgeries.  

Those who have registered to take part will receive an email with full details on how to get ready for this course.  

If you’re new to this training event format, or to CDCS training events in general, read more on what to expect from CDCS training. Here you will also find details of our cancellation and no-show policy, which applies to this event

 

Level   

Participants should have a basic familiarity with R or Python.  

You should be comfortable installing and loading packages, working with data frames, and running simple code chunks. 

For those working with R, some prior exposure to the Tidyverse syntax (e.g. using the pipe %>% and functions like mutate() or filter()) will make the hands-on parts easier to follow, though it is not strictly required.  

If you want to learn the basics of Python or R, you can take our introductory courses Getting Started with Python for Research and Getting Started with R for Research.

No prior experience with web scraping or HTML is assumed. 

 

Learning Outcomes  

  • Make informed decisions about when web scraping is appropriate, and when alternative approaches (e.g., APIs, open data sources) should be used. 

  • Explain the main legal and ethical considerations in web scraping, including terms of service, copyright, privacy, and consent. 

  • Identify and interpret the HTML structure of a static web page. 

  • Use R or Python tools to scrape and organise content from a simple static website. 

     

Skills   

By attending this course, you will familiarise yourself with the following skills  

  • Understanding and working with basic HTML structures 
  • Using the R package rvest or the Python library Beautiful Soup to scrape static websites 

     

Explore More Training

 

Return to the Training Homepage to see other available events

 

Room 4.35, Edinburgh Futures Institute

This room is on Level 4, in the North East side of the building.

When you enter via the level 2 East entrance on Middle Meadow Walk, the room will be on the 4th floor straight ahead.

When you enter via the level 2 North entrance on Lauriston Place underneath the clock tower, the room will be on the 4th floor to your left.

When you enter via the level 0 South entrance on Porters Walk (opposite Tribe Yoga), the room will be on the 4th floor to your right.

You might be interested in

an old map of Acotland with the text "Jennifer Smith & Brian Aitken, Project deep Dive"

Who Speaks Scots Where: What Crowdsourcing Reveals

Graphic for a workshop titled ‘Foundations of Webscraping.’ The background is a black-and-white photograph of students working together in a design studio with maps and models. A large teal ampersand featuring an illustration of Ada Lovelace is placed on the left. The logo of the Centre for Data, Culture & Society (DCS) appears in the top right corner.

Collecting Data from the Web: Foundation of Webscraping

Graphic for a workshop titled ‘Text Classification in Practice: From Topic Models to Transformers.’ The background shows handwritten historical letters. A large green ampersand featuring an illustration of Ada Lovelace is placed on the left. The logo of the Centre for Data, Culture & Society (DCS) appears in the top right corner.

Text Classification in Practice: From Topic Models to Transformers

Graphic for a workshop titled ‘Using API for Research.’ The background is a black-and-white photograph of people working with printing equipment and patterned sheets. A large magenta ampersand featuring an illustration of Ada Lovelace is placed on the left. The logo of the Centre for Data, Culture & Society (DCS) appears in the top right corner.

Using API for Research

Graphic for a workshop titled ‘Getting Started with Descriptive Statistics.’ The background is a black-and-white photograph of people reading and working in a library. A large magenta ampersand featuring an illustration of Ada Lovelace is placed on the left. The logo of the Centre for Data, Culture & Society (DCS) appears in the top right corner.

Getting Started with Descriptive Statistics

Graphic for a workshop titled ‘Data Viscualisation’ The background is a collage of historical printed text with an overlaid image of a wolf. A large green ampersand featuring an illustration of Ada Lovelace is placed on the left. The logo of the Centre for Data, Culture & Society (DCS) appears in the top right corner

Digital Method of the Month: Data Visualisation

Graphic for an event titled ‘BYOD Festival.’ The background is a black-and-white photograph of people sitting around a table, drinking tea and playing cards. A large magenta ampersand featuring an illustration of Ada Lovelace is placed on the left. The logo of the Centre for Data, Culture & Society (DCS) appears in the top right corner.

Bring Your Own Data (BYOD) Fest

graphic of a black and white Christmas tree background with colourful baubles and snowflakes. The text "Dorothy Berry, CDCS Annual Lecture 2025" is overlayed."

CDCS Annual Lecture 2025

Graphic for a workshop titled ‘Using Prompting Efficiently for Research.’ The background shows an aged, torn book page with visible text. A large green ampersand featuring an illustration of Ada Lovelace is placed on the left. The logo of the Centre for Data, Culture & Society (DCS) appears in the top right corner.

Using Prompting Efficiently for Research

black and white photograph of a person drinking tea out of a flaks on top of a hill.

CDCS December Fika