scrap: Simple website scraping

Description Usage Arguments Value Examples

View source: R/scrap.R

Description

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

Usage

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

Arguments

link

the link of the webpage to scrap

node

the 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 scrap 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)

feddelegrand7/ralger documentation built on Jan. 14, 2020, 12:33 p.m.