try_read_html: Try and retry reading a webpage

Description Usage Arguments Value

View source: R/functions.R

Description

Try reading a webpage possibly multiple times in case of error, with delays before, between, and after the attempts.

Usage

1
2
3
4
5
6
7
8
try_read_html(
  expose_url,
  delay_before = 0,
  delay_after = 1,
  max_tries = 2,
  interval = max(delay_before, delay_after),
  ...
)

Arguments

expose_url

URL

delay_before, delay_after

Delay (in seconds) before and/or after trying to read the webpage

max_tries

Maximum number of attempts

interval

Interval between the attempts; defaults to the maximum of the two delay argument.

...

Additional arguments for xml2::read_html()

Value

The result of xml2::read_html(), or an object of class "try-error" in case of error.


alexanderbrenning/alexmisc documentation built on Jan. 7, 2022, 5:41 p.m.