## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")

## ----setup--------------------------------------------------------------------
library(crawlee)

## ----eval = FALSE-------------------------------------------------------------
# resultado <- crawler("https://example.com") |>
#   cr_options(delay = 0.5, max_depth = 2) |>
#   cr_use_http() |>
#   cr_on_html(function(ctx) {
#     ctx$push_data(list(
#       url    = ctx$request$url,
#       titulo = ctx$page |> rvest::html_element("h1") |> rvest::html_text2()
#     ))
#     ctx$enqueue_links()
#   }) |>
#   cr_run() |>
#   cr_collect()

## ----eval = FALSE-------------------------------------------------------------
# ctx$enqueue_links(
#   glob    = "*/blog/*",
#   exclude = "*/tag/*",
#   label   = "article"
# )

