parse_keyval_tbl: Parse categories and their values in product detail page

Description Usage Arguments Value Examples

Description

Returns all categories (titles) and their values in the detailed product description page. The categories are returned in the order that they appear in on the page, and the categories might not be identical on the detailed product description pages of different products within the same category.

Usage

1
parse_keyval_tbl(detailpagehtml)

Arguments

detailpagehtml

html structure from a single geizhals page listing details of a specific item.

Value

A tibble (data.frame) with two columns (key and value), containing the categories and their values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
## get data from multiple geizhals category pages:
url_geizhals <- "https://geizhals.at/?cat=acam35"
listpagehtml_list <- fetch_all_listpages(url_geizhals, max_pages = 2)
dat_listpage <- parse_all_listpages(listpagehtml_list)
## get url of a single detail page and read html:
url_detailpage <- dat_listpage[["detailpage_url"]][1]
detailpagehtml <- xml2::read_html(url_detailpage)
## get categories and their values:
parse_keyval_tbl(detailpagehtml)

## End(Not run)

ingonader/rgeizhals documentation built on May 29, 2019, 3:05 a.m.