Yeah, it's a bit of a bear. The examples in the docs are helpful, though; you can often adapt them to what you need. The package is object-oriented in a way that most in R aren't; a lot of the functions you need will be methods of the remote driver. What works for me (but may or may not for you, annoyingly):
library(RSelenium)
library(rvest)
rd <- rsDriver()
rd$client$navigate('http://www.uscho.com/recaplink.php?gid=1_970_20172018')
h <- rd$client$getPageSource()
h <- h[[1]] %>% read_html()
rd$client$close()
rd$server$stop()
rm(rd)
boxgoals <- h %>%
html_node('#boxgoals') %>%
html_table()
boxgoals
#> Per Team Scorer Assist 1 Assist 2 Goal Type Time
#> 1 1 Boston College-1 Connor Moore Mike Booth Casey Carreau 15:30
#> 2 2 Providence-1 Erik Foley Spenser Young 4x4 08:22
#> 3 2 Providence-2 Ben Mirageas Scott Conway Spenser Young GWG PPG 5x4 19:14
This works, but is sort of a pain. splashr is a newer alternative that is built to contain a lot of the messiness in docker. Also nicely, its render_html function returns an xml2 object like rvest uses, so it can integrate directly. Note you'll need to install and start docker before the following will work.
library(splashr)
library(rvest)
# install_splash() # run this once to install the docker image
sp <- start_splash()
pg <- render_html(url = 'http://www.uscho.com/recaplink.php?gid=1_970_20172018')
stop_splash(sp)
boxgoals <- pg %>%
html_node('#boxgoals') %>%
html_table()
boxgoals
#> Per Team Scorer Assist 1 Assist 2 Goal Type Time
#> 1 1 Boston College-1 Connor Moore Mike Booth Casey Carreau 15:30
#> 2 2 Providence-1 Erik Foley Spenser Young 4x4 08:22
#> 3 2 Providence-2 Ben Mirageas Scott Conway Spenser Young GWG PPG 5x4 19:14
There's much more to using docker fully, of course. Here's a nice tutorial to get you started. In this case, you don't really need to know much, but it is important to realize that install_splash will download a 1.2Gb docker image to your machine. The above tutorial explains how to delete it afterwards if you want your disk space back.