curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: redirect URL

From: Nicholas Chambers <nchambers_at_lightspeedsystems.com>
Date: Tue, 21 Mar 2017 09:07:50 -0500

On 3/21/17 8:47 AM, Claudio Piga wrote:
> Dear Curl users
> I am totally new to curl and its use, but I hope this query makes
> sense to you. Apologies if it is a rather mundane type of problem.
>
> I have to save queries for my research. I have to deal with urls of
> this kind:
>
> http://www.booking.com/searchresults.html?src=index&nflt=&lang=en-gb&checkin_monthday=14&checkin_year_month=2017-6&checkout_monthday=15&checkout_year_month=2017-6&interval_of_time=any&flex_checkin_year_month=any&&group_adults=2&group_children=0&dest_type=city&dest_id=-1454990&selected_currency=GBP&radius=2
>
> For brevity's sake, define this as <url>
>
> Using the DOS Command Prompt, from the directory where the curl.exe is
> stored, I issued the following command:
>
> *curl -o example.html <url>
> *
> I think curl does not seem to like all the &, so I also tried the version:
I can't speak for the DOS shell, but to POSIX shells like bash or zsh, &
is a special symbol meaning "run in the background". To cURL, there
shouldn't be a difference. So you will indeed need to put it in quotes
so that way it is passed to cURL without the shell parsing the URL.

>
> *curl -o example.html "<url>"
> *
>
> that is, I put the whole url in quotes.
> Note that the url (without quotes) works in a brower and downloads the
> relevant page. Unfortunately, the file created by curl is empty.
> Could you please refer me to the correct syntax for the curl command?

That should be the correct syntax. What is the output of curl -sLvvvD-
-o example.html "<url>" ?
> Many Thanks
> Claudio
>
> --
>
>
>
> -----------------------------------------------------------
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
> Etiquette: https://curl.haxx.se/mail/etiquette.html

-- 
Nicholas Chambers
Technical Support Specialist
nchambers_at_lightspeedsystems.com
1.800.444.9267
www.lightspeedsystems.com

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-03-21