Q:

When looping through a data frame of URLs using Rvest, I am getting an "invalid description" error.  What's going on? 

Here's my code:
location_df <- data.frame(unique(location_html),stringsAsFactors = FALSE)

for (i in location_df) {
  con <- url(i,"rb")
  webpage <- read_html(con)
  . 
  <operations performed here>
  . 
}

To provide more information about location_df here's the result of str(location_df):
'data.frame':   659 obs.  of  1 variable:
 $ location_html: chr  "https://www.faredetective.com/farehistory/flights-to-
Al_Ain-AAN.html" "https://www.faredetective.com/farehistory/flights-to-
Allentown-ABE.html" "https://www.faredetective.com/farehistory/flights-to-
Albuquerque-ABQ.html" "https://www.faredetective.com/farehistory/flights-to-Abuja-ABV.html" ...

The error I am getting says "Error in url(i, "rb") : invalid 'description' argument"
When I paste in one of the strings within location_df it works, but I can't get it to successfully loop over the data frame without triggering this error on the first loop attempt.  What is wrong with my code?  
(I apologize if this has been answered somewhere else; I looked through all "similar questions" and could not find an answer that fixed my problem)

A:

You forgot to specify the column in the for loop.   Try:
for (i in location_df$location_html) {
  con <- url(i,"rb")
  webpage <- read_html(con)
  # . 
  # <operations performed here>
  #   . 
}

