Max Max - 1 year ago 129
Ruby Question

Ruby, Capybara, getting actual file URL from a redirect link?

I'm trying to automate the download of two files from a website, but the link is actually a redirect that goes to the actual URL. But I can't figure out how to catch that URL (so I can then pass it to wget). Any ideas?

Answer Source

There is no direct way to get the destination of a redirect in Capybara, but you should be able to set the --max-redirect wget option to something more than the default 0 and wget should follow the redirect for you.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download