parse_ratings_n: Parse number of product ratings from geizhals category page

Description Usage Arguments Value Examples

Description

Returns the number of product ratings for each product in a geizhals page listing all products within a specific category (i.e., not the generic page-wide search from the search bar, but the page showing all items within a category. Filters might be applied, only results corresponding to that filter will be shown and scraped.) The order of items returned by the function might not correspond to the order listed on the webpage, but it is the same order in all related functions.

Usage

1
parse_ratings_n(listpagehtml)

Arguments

listpagehtml

html structure from a single geizhals page listing items in a selected category, as gathered via xml2::read_html() or via a single entry of the list of listing pages resulting from fetch_all_listpages.

Value

A numeric vector of the number of product ratings for each item appearing in the geizhals listing page.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
## get html of a geizhals category listing page via read_html:
url_geizhals <- "https://geizhals.at/?cat=acam35"
listpagehtml <- xml2::read_html(url_geizhals)
parse_ratings_n(listpagehtml)

## get html of multiple geizhals category listing pages:
listpagehtml_list <- fetch_all_listpages(url_geizhals)
parse_ratings_n(listpagehtml_list[[1]])

## End(Not run)

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