शुरू करेंमुफ़्त में शुरू करें

Parse hyperlinks into a data frame

Have a look at the following ul list of "helpful links".

It consists of three li elements that in turn contain a elements with the links:


Helpful links

Compiled with help from Google.


The corresponding HTML code is available as a string in hyperlink_raw_html.

In this exercise, you'll parse these links into an R data frame by selecting only a elements that are within li elements.

PS: You'll use tibble(), a function from the Tidyverse, for that. tibble() is basically a trimmed down version of data.frame(), which you certainly already know. Just like data.frame(), you specify column names and data as pairs of column names and values, like so:

my_tibble <- tibble(
  column_name_1 = value_1,
  column_name_2 = value_2,
  ...
)

यह अभ्यास पाठ्यक्रम का हिस्सा है

Web Scraping in R

पाठ्यक्रम देखें

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Extract all the a nodes from the bulleted list
links <- hyperlink_raw_html %>% 
  read_html() %>% 
  html_elements('li ___')
कोड संपादित करें और चलाएँ