alt_get: Get HTML Attributes from the Image Elements of a Web Page

Description Usage Arguments Value Examples

View source: R/read.R

Description

Scrape (politely) a web page's HTML and extract the attributes from each image element (<img>) on that page.

Usage

1
alt_get(webpage, all_attributes = FALSE)

Arguments

webpage

A character string describing the URL of a webpage. Must be a full path including https://www. where appropriate.

all_attributes

Logical. Do you want to return all the image attributes as columns or just src, alt and longdesc (if it exists)?

Value

A tibble object with classes tbl_df, tbl and data.frame. One row per image element and one column per attribute, unless (all_attributes = FALSE), which returns only:

Examples

1
2
3
4
5
## Not run: 
    test_url <- "https://www.bbc.co.uk/news"
    alt_get(webpage = test_url)
    
## End(Not run)

matt-dray/altcheckr documentation built on Jan. 21, 2021, 8:02 a.m.