scrap: Simple website scraping

Description Usage Arguments Value Examples

View source: R/scrap.R

Description

This function is used to scrape one element from a website.

Usage

1
scrap(link, node, clean = FALSE, askRobot = FALSE)

Arguments

link

the link of the web page to scrape

node

the HTML or CSS element to consider, the SelectorGadget tool is highly recommended

clean

logical. Should the function clean the extracted vector or not ? Default is FALSE.

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

1
2
3
4
5
6
# Extracting imdb top 250 movie titles

link <- "https://www.imdb.com/chart/top/"
node <- ".titleColumn a"

scrap(link, node)

ralger documentation built on March 18, 2021, 1:06 a.m.