xpath_sibling_between: Generate xpath to find sibling nodes between two elements The...

View source: R/utils_scraping.R

xpath_sibling_betweenR Documentation

Generate xpath to find sibling nodes between two elements The function produces a compounding xpath with each subsequent argument provided. Thus the final argument specified will be the node that is selected by the resulting xpath with the exception of nested_tag_contains which helps to identify a nested tag by its contents

Description

Generate xpath to find sibling nodes between two elements The function produces a compounding xpath with each subsequent argument provided. Thus the final argument specified will be the node that is selected by the resulting xpath with the exception of nested_tag_contains which helps to identify a nested tag by its contents

Usage

xpath_sibling_between(
  start_tag,
  following_sibling,
  preceding_sibling,
  nested_tag,
  nested_tag_contains
)

Arguments

start_tag

chr xpath of the upper bounding element

following_sibling

chr relative xpath of the lower bounding element

preceding_sibling

chr relative xpath for the type of elements in between the upper and lower bounding elements to retrieve

nested_tag

chr relative xpath of an element nested within the preceding_sibling elements

nested_tag_contains

chr of text that the nested_tag element contains (in order to identify it. The nested tag element itself will be selected).

Value

chr xpath statement


yogat3ch/UU documentation built on May 31, 2024, 10:14 p.m.