curl-users
Re: newline issues
Date: Sun, 16 Oct 2016 13:36:18 -0400
Hey Ray.
Thanks. Confirms what I saw. Using a headless browser gets the correct
"\n\r. Is there a way to have curl "substitute" the "\n\r" for the \r
I didn't see anything in my searches. Did I just miss something?
Thanks
On Sun, Oct 16, 2016 at 1:25 PM, Ray Satiro via curl-users <
curl-users_at_cool.haxx.se> wrote:
> On 10/14/2016 9:01 PM, bruce wrote:
>
>> Basically, a portion of the returned content in/from the curl, appears to
>> be missing linefeeds (newlines)
>>
>> The test curl:
>>
>> echo '' > aa.lwp
>> curl -v -A "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
>> Firefox/45.0" --cookie-jar aa.lwp --cookie aa.lwp -L "
>> http://www.bu.edu/link/bin/uiscgi_studentlink/uismpl?Modul
>> eName=univschs.pl"
>>
>
> [...]
>
> <TR>
>> <TD VALIGN="TOP">
>> <SELECT NAME=Subject>
>> <OPTION value="">any</option>
>> <OPTION VALUE="ZULU">Zulurubang's Studiessngo Speakers of Other
>> Languages(TESOL)rning
>> </SELECT>
>> </TD>
>>
>
> Yup, you're right it's missing newlines. It looks as though the perl
> script generating the page for whatever reason uses CRs but not LFs for
> that particular section. I get the same content in a browser and curl, but
> the output to the screen looks different in the console because of the
> mixed line endings. Recall when a CR is output on your screen it goes back
> to the beginning of the line without going down a line. for example
>
> $ printf "eeeee\rdddd\rccc\rbb\ra"
> abcde
>
> The same thing is happening here. The page has many options that end in CR
> and the last one ends in LF.
>
> <OPTION VALUE="YORUBA">Yoruba[CR]
> <OPTION VALUE="ZULU">Zulu[LF]
>
> which becomes
>
> <OPTION VALUE="ZULU">Zuluruba
>
> and many more of those OPTIONs from earlier makes that really weird string
> you saw.
>
>
> -------------------------------------------------------------------
> List admin: https://cool.haxx.se/list/listinfo/curl-users
> FAQ: https://curl.haxx.se/docs/faq.html
> Etiquette: https://curl.haxx.se/mail/etiquette.html
>
>
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-users
FAQ: https://curl.haxx.se/docs/faq.html
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-10-16