[R] Opening or activating a URL to access data, alternative to browseURL
murdoch.duncan at gmail.com
Thu Sep 29 22:59:16 CEST 2016
On 29/09/2016 3:29 PM, Ryan Utz wrote:
> Hi all,
> I've got a situation that involves activating a URL so that a link to some
> data becomes available for download. I can easily use 'browseURL' to do so,
> but I'm hoping to make this batch-process-able, and I would prefer to not
> have 100s of browser windows open when I go to download multiple data sets.
> Here's the example:
> # This opens the URL and creates a link to machine-readable data on the
> page, which I can then download by simply doing this:
> However, I can only get the second line above to work if the thing in line
> #1 has been opened in a browser already. Is there any way to allow me to
> either 1) close the browser after it's been opened or 2) execute the line
> #2 above without having to open a browser? We have hundreds of species that
> you can see after the '&kind=' bit of the URL, so I'm trying to keep the
> browsing situation sane.
You'll need to figure out what happens when you open the first page.
Does it set a cookie? Does it record your IP address? Does it just
build the file but record nothing about you?
If it's one of the simpler versions, you can just read the first page,
wait a bit, then read the second one.
If you need to manage cookies, you'll need something more complicated.
I don't know the easiest way to do that.
More information about the R-help