Skip to content

Using a CSS selector in follow_link() does not work #38

@jankowtf

Description

@jankowtf

Seems like so far you only implemented cases where i is either a numerical position index or a string that is matched against the href description/text, but not the case when its a CSS selector or XPath statement:

s <- html_session("http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=ssd",
  httr::user_agent("Mozilla/5.0"))

## `i` is text that should be matched:
s %>% follow_link("Prime")

## `i` is valid selector:
try(s %>% follow_link("#result_0 .a-spacing-base+ .a-spacing-mini .a-spacing-none"))

## `i` is invalid selector:
s %>% follow_link("abcd")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions