And just to add a bit to this here ... since the html_text
function returns a string (and only one string), then length
will return 1. Generally, if you would like to count the number of characters in a string, you can use nchar
. And as @Yarnabrina mentions, if you want to make a vector of digits instead, then you need to split the string into its digits.
And linking to this post regarding programatically scrolling down the page - apparently it can be done using RSelenium
: how to scrape, do not load whole page until we scroll down?