Skip to main content
HomeR

Course

Web Scraping in R

IntermediateSkill Level
4.7+
88 reviews
Updated 04/2024
Learn how to efficiently collect and download data from any website using R.
Start Course for Free
RData Preparation
4 hr
13 videos
45 Exercises
3,600 XP
14,981
Statement of Accomplishment

Create Your Free Account

Continue with GoogleShow more options

or


By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Loved by learners at thousands of companies

Group

Training a Team?

Try for Business

Course Description

Have you ever come across a website that displays a lot of data such as statistics, product reviews, or prices in a format that’s not data analysis-ready? Often, authorities and other data providers publish their data in neatly formatted tables. However, not all of these sites include a download button, but don’t despair. In this course, you’ll learn how to efficiently collect and download data from any website using R. You'll learn how to automate the scraping and parsing of Wikipedia using the rvest and httr packages. Through hands-on exercises, you’ll also expand your understanding of HTML and CSS, the building blocks of web pages, as you make your data harvesting workflows less error-prone and more efficient.

Prerequisites

Intermediate RIntroduction to the Tidyverse
1

Introduction to HTML and Web Scraping

In this chapter, you'll be introduced to Hyper Text Markup Language (HTML), a declarative language used to structure modern websites. Using the rvest library, you'll learn how to query simple HTML elements and scrape your first table.
Start Chapter
2

Navigation and Selection with CSS

Cascading Style Sheets (CSS) describe how HTML elements are displayed on a web page, including colors, fonts, and general layout. In this chapter, you'll learn why CSS selectors and combinators are a crucial ingredient for web scraping.
Start Chapter
4

Scraping Best Practices

Now that you know how to extract content from web pages, it's time to look behind the curtains. In this final chapter, you’ll learn why HTTP requests are the foundation of every scraping action and how they can be customized to comply with best practices in web scraping.
Start Chapter
Web Scraping in R
Course
Complete

Earn Statement of Accomplishment

Add this credential to your LinkedIn profile, resume, or CV
Share it on social media and in your performance review
Enroll Now

Don’t just take our word for it

*4.7
from 88 reviews
77%
19%
3%
0%
0%
  • Naqash
    6 days ago

  • Basak
    last week

  • José
    2 weeks ago

  • Marcos Antonio
    3 weeks ago

  • Asad
    4 weeks ago

  • Avinashkumar
    4 weeks ago

    Very useful course! Learned a lot about scraping websites using R, especially XPath and handling HTTP requests. The exercises were practical and easy to follow

Naqash

Basak

José

FAQs

Which R packages are used for web scraping in this course?

You will use the rvest package for parsing HTML and extracting data, along with the httr package for making HTTP requests and handling web page responses.

Do I need to know HTML and CSS before starting this course?

No. The course teaches you the HTML and CSS fundamentals needed for web scraping, including how elements are structured and how to use CSS selectors to target data.

What website is used for hands-on scraping practice?

You will practice automating the scraping and parsing of Wikipedia pages, learning to extract tables and other structured content from real web pages.

Will I learn to handle common scraping errors and edge cases?

Yes. The course teaches you techniques to make your data harvesting workflows less error-prone and more efficient when dealing with real-world web content.

What can I do with web scraping skills in a data science workflow?

You can collect data from websites that lack download options, such as price listings, statistics tables, and product reviews, and prepare it for analysis in R.

Join over 19 million learners and start Web Scraping in R today!

Create Your Free Account

Continue with GoogleShow more options

or


By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Grow your data skills with DataCamp for Mobile

Make progress on the go with our mobile courses and daily 5-minute coding challenges.