getElementAttr: A Webscrape Function

Description Usage Arguments Examples

Description

This function allows you to extract attribute value from the element and returns vector.

Usage

1
getElementAttr(html, cssSelector, Attr)

Arguments

html

html code of the page

cssSelector

css selector of the element

Attr

attribute name whose value to be fetched

Examples

1
2
html <- xml2::read_html("https://www.drugshortagescanada.ca")
getElementAttr(html,"table tbody tr td","href")

kunal15abc/ezscrape documentation built on June 1, 2019, 5:01 a.m.