Closed tklebel closed 6 years ago
JSTOR blocks requests made without a user agent.
Solution: set a proper user agent.
This could be a string like "jstor R package (https://ropensci.github.io/jstor/)" or a string for a browser.
"jstor R package (https://ropensci.github.io/jstor/)"
The implementation is simple:
link <- "https://www.jstor.org/titlelists/journals/archive?fileFormat=xls" journal_list <- tempfile() handle <- curl::new_handle() handle <- curl::handle_setheaders(handle, "User-Agent" = "Mozilla/1.22") curl::curl_download(link, journal_list, handle = handle)
I sent a mail to the JSTOR support, waiting for their response.
Setting the user agent as above seems to work on UNIX but not on Windows...
JSTOR blocks requests made without a user agent.
Solution: set a proper user agent.
This could be a string like
"jstor R package (https://ropensci.github.io/jstor/)"
or a string for a browser.The implementation is simple:
I sent a mail to the JSTOR support, waiting for their response.