
Master web scraping basics in R by using html classes and ids, and compare harvest and selenium for scraping diverse pages, apis and json, turning data into a tidy dataset.
Prerequisites for this course include familiarity with the titmus suite of packages, as it is not a beginner course; containers and images enable a consistent learning environment.
Learn to scrape a Wikipedia table with R by loading html, extracting the covid-19 by country and territory table, and cleaning it into a tidy data frame.
Learn to scrape a Wikipedia table in 20 lines of code, clean and reshape data with R by selecting columns, renaming them, removing footnotes and nonnumeric values for analysis.
Set up a Docker Compose driven infrastructure with studio and selenium containers to enable web scraping with R, locking image versions to ensure reproducible libraries.
Explore how HTML uses tags, classes, and IDs to structure and style pages for scraping. Learn to select headings and content with tag, class, and id to extract exact data.
Learn to scrape reviews from a Trustpilot page using R, extract star ratings and text, and assemble a structured dataset with a reusable function across multiple sites.
Learn to read html with R, extract a list of reviews by selecting elements with the review class, and loop through each item to assemble review data for consumers.
Extract and structure each review by retrieving the id, title, text, and star rating, then parse the timestamp from embedded JSON for analysis.
Extract reviewer details from each review by scraping consumer information, unique id, email, name, and review count, and assemble them into a consumer table with a reusable function.
Create a function to extract all reviews and map them into a data frame, looping across pages to collect 20 reviews with id, title, text, stars, timestamp, and user details.
Learn to loop through all pages in R to extract and compile all reviews, deduplicating with distinct, and save a single data frame of nearly 500 unique reviews.
Learn to clean scraped data by converting reviews and stars to numbers, formatting timestamps, and preparing a ready-to-analyze data frame for any web page.
Attempt the scrape of a dynamic Asda groceries page to extract yogurt titles into a tidy data frame, and learn why client-side rendering blocks HTML extraction compared to server-side rendering.
Compare server-side rendering where the server builds and sends HTML, enabling easy scraping. Show client-side rendering where the client builds HTML, requiring selenium to obtain scrape-ready HTML.
Learn to scrape client-side rendered webpages by coordinating a Selenium server with Firefox, using a remote driver, and waiting for rendering before extracting the html for the yogurts we want.
Learn to extract a list of products from a webpage using R by locating the product list container and iterating through product items, then gathering data across pages.
Learn to extract product details from HTML, including title, volume, price, review count, and rating stars, and assemble them into a data frame.
Create a function that processes a list of products, mapping it to a data frame with title, volume, price, review count, and ratings, handling missing reviews.
Learn to scrape all product pages in R by detecting the last page from eight-page pagination and iterating to extract data from each page.
Learn to build a loop in R that navigates eight web pages with selenium, waits for page load, and saves each page’s HTML to a local folder for easy scraping.
Parse the saved HTML files with R, loop through them with a custom function to extract product information, and build a data frame for all pages.
Learn to clean and standardize saved data by extracting numeric volume from product data and removing units. Create a new volume column while handling lists with map.
Clean the saved data by removing the pound sign and parentheses, converting the price to numeric, extracting star ratings, and building a clean dataset with volume and reviews.
Learn to use Selenium to save dynamic web pages to disk, manually save complete pages, organize cookies data into files, and run a script to extract and clean information.
Learn to extract data from client-side rendered pages by inspecting the browser network panel, identifying XHR API calls, and reverse engineering the API request to read data into R.
Learn to scrape Udemy data by inspecting API calls, retrieve course titles and metadata via the Udemy API, and assemble results into a data frame.
Explore using the Udemy API to fetch the first thousand courses by paging through 20 pages of 50 items, returning clean, well-structured data for your analysis.
In this course you will learn:
the basics of web scraping (using tags, classes and ids)
two great R packages: Rvest and Selenium
to scrape server-side and client-side rendered pages
to get data from json API’s
If you have ever wanted to collect:
text from the internet for NLP!
numbers from websites to visualize!
tables of data from the internet to put into your model!
or anything else involving getting data from the internet.
Then this course is for you!
At the end of the course you will be able to:
Extract data from structured tables on the internet
Collect text data from a website (like reviews) and structure it in a tidy data set
Collect a diverse set of data points from a website (like products) and structure it in a tidy data set
Collect structured data from an API - ready for analysis
Scrape websites that are normally very hard to extract data from.