fetch_next_listpage: Fetch html of next listing page

Description Usage Arguments Value Examples

Description

Takes the html of a listing page as input, extracts the url for the next listing page, reads the html and returns it.

Usage

1
fetch_next_listpage(listpagehtml, domain = "https://geizhals.at")

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.

domain

Character vector of length one specifying the domain. Defaults to "https://geizhals.at".

Value

An xml document as returned by xml2::read_html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
## url of geizhals.at page:
url_geizhals <- "https://geizhals.at/?cat=acam35"
listpagehtml_p01 <- xml2::read_html(url_geizhals)
## get information from this listing page:
parse_single_listpage(listpagehtml_p01)
## get next listing page:
listpagehtml_p02 <- fetch_next_listpage(listpagehtml_p01)
#' ## get next listing page and get information:
parse_single_listpage(listpagehtml_p02)

## url of geizhals.eu page:
url_geizhals <- "https://geizhals.eu/?cat=acam35"
listpagehtml_01 <- xml2::read_html(url_geizhals)
## get information from this listing page:
parse_single_listpage(listpagehtml_01, domain = "https://geizhals.eu")
## get next listing page:
listpagehtml_p02 <- fetch_next_listpage(listpagehtml, domain = "https://geizhals.eu")
#' ## get next listing page and get information:
parse_single_listpage(listpagehtml_p02, domain = "https://geizhals.eu")

## End(Not run)

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