Download a CSV file behind site login that has URL redirection using HTTR or rvest

I'm looking for help downloading a .csv file at a site that requires a login. I have no issues with the code that gets me to login. It works, because I'm able to scrape HTML at the website behind the login.

Here's the code I use to login:

login_baseballhq <- function(bbhq_id = Sys.getenv("bbhq_id"),
                        bbhq_password = Sys.getenv("bbhq_password")) {

  # Open Session on Base Login Page
  my_session <- rvest::html_session("")
  unfilled_forms <- rvest::html_form(my_session)
  login_form <- unfilled_forms[[1]]
  filled_form <- rvest::set_values(login_form, name = bbhq_id, pass = bbhq_password) # fill the form
  login_session <- rvest::submit_form(my_session, filled_form)

Code used to scrape HTML

 url <- ""

  # Get Page Session Function?
  page <- rvest::jump_to(login_session, url)

  page <-
    page %>%

How do I go about downloading a .csv file at the site? The URL I click to get the file is "".

When I copy and paste the link to a new browser tab I get the following message.

Please login to BaseballHQ.Com before attempting to download a file. 

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.