Even though phantomjs is dead, it is quite useful anyway in a nice Rscript.
Headless Chrome with R Selenium: https://github.com/ropensci/RSelenium/issues/138
Puppeteer is googles tool, and can also be used in R: https://stackoverflow.com/questions/53339598/scraping-javascript-render…
With login example (not working?): https://stackoverflow.com/questions/63366545/puppeteer-i-want-to-log-in…
PhantomJS vs Puppeteer: https://stackoverflow.com/questions/53339598/scraping-javascript-render…
Headless Chrome: https://speakerdeck.com/rlesur/headless-chrome-automation-with-r-the-cr…
Headless chrome and downloading files hints: https://stackoverflow.com/questions/60292290/rselenium-chrome-how-to-se…