You can get the budget value like this:
library(tidyr) # for extract_numeric
library(rvest)
movie <- read_html("http://www.imdb.com/title/tt1490017/")
movie %>%
html_nodes("#titleDetails :nth-child(11)") %>%
html_text() %>%
extract_numeric()
[1] 6e+07
Your example looks similar to an example in the rvest package vignette. That vignette suggests you use SelectorGadget, which I used to find the CSS selector that would return only the Budget element. To see that element, run all but the last piped line of this series, and you'll see why I chose to parse it with extract_numeric
from tidyr.
You'll need the latest version of rvest
to run this as I'm using the read_html()
function, which has replaced html()
used in your example.