Learn R Programming

ralger (version 2.2.4)

attribute_scrap: Scraping attributes from HTML elements

Description

This function is used to scrape attributes from HTML elements

Usage

attribute_scrap(link, node, attr, askRobot = FALSE)

Arguments

link

the link of the web page to scrape

node

the HTML element to consider

attr

the attribute to scrape

askRobot

logical. Should the function ask the robots.txt if we're allowed or not to scrape the web page ? Default is FALSE.

Value

a character vector.

Examples

Run this code
# NOT RUN {
# Extracting the web links within the World Bank research and publications page

link <- "https://ropensci.org/"

# scraping the class attributes' names from all the anchor

attribute_scrap(link = link, node = "a", attr = "class")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab