Learn R Programming

rvest (version 0.3.1)

jump_to: Navigate to a new url.

Description

jump_to() takes a url (either relative or absolute); follow_link takes an expression that refers to a link (an tag) on the current page.

Usage

jump_to(x, url, ...)

follow_link(x, i, css, xpath, ...)

Arguments

x
A session.
url
A URL, either relative or absolute, to navigate to.
...
Any additional httr configs to apply to this request.
i
You can select with: [object Object],[object Object]
css
Nodes to select. Supply one of css or xpath depending on whether you want to use a css or xpath selector.
xpath
Nodes to select. Supply one of css or xpath depending on whether you want to use a css or xpath selector.

Examples

Run this code
s <- html_session("http://had.co.nz")
s %>% jump_to("thesis/")
s %>% follow_link("vita")
s %>% follow_link(3)
s %>% follow_link("vita")

Run the code above in your browser using DataLab