curl-users
RE: Please help - server doesn't like my CURL syntax [solved!-thank you]
Date: Fri, 6 Dec 2002 23:46:19 -0800
Hello again, Ralph:
Please disregard my previous post - I have found the
problem, and in fact your original response DID help me a
great deal, thank you very much.
Under the Albert Einstein motto "A problem can't be solved
with the same thinking that created it" I started pondering
why you get the correct page on Linux and I don't on Win32,
also guided by your comment about your Linux shell no liking
the [] and () characters which my Win32 shell has no problem
with.
So I began testing for characters in the "http://" part of
the command line syntax to see if perhaps my Win32 shell may
also "dislike" some characters I don't know about - and
bingo!
In the part "quicksearch_subset=ean%7CEAN"
there is the URL-encoded character "|" (encoded as "%7C")
so in fact the "ean%7CEAN" reads "ean|EAN".
That was the culprit. A simple encoding change in THAT
little part solved the whole thing and I can finally exhale
and go get some sleep. I've been working on this sucker for
over 14 hours today!
Thank you again for your response; although it did not have
an explicit answer to my question it provided precisely the
type of breakthrough I needed to solve the puzzle.
Have a nice weekend!
> -----Original Message-----
> From: curl-users-admin_at_lists.sourceforge.net
> [mailto:curl-users-admin_at_lists.sourceforge.net]On
> Behalf Of Ralph
> Mitchell
> Sent: Friday, December 06, 2002 10:15 PM
> To: curl-users_at_lists.sourceforge.net
> Subject: Re: Please help - server doesn't like my
> CURL syntax
>
>
> This probably won't help much, but when I copy
> your curl command line
> into a file, execute it, then display the html in
> a browser, I get the
> exact same page as the browser shows when going
> direct to the page. In
> other words, your curl command line isn't broken...
>
> The *only* change I made was to put double-quotes
> around the browser
> signature because my shell would do strange
> things with the [ ] and ( )
> parts.
>
> So, it works just fine on a Gentoo Linux box using:
>
> curl 7.10.1 (i686-pc-linux-gnu)
> libcurl/7.10.1 OpenSSL/0.9.6g
> zlib/1.1.4
>
> No cookies, no redirects, nothing fancy... There
> is, however, an
> enormous amount of html fluff in the returned
> page. About 3/4's through
> the file is the "Zoekresultaten - leverbare
> titels" text from the top of
> the white area on the page.
>
> Ralph Mitchell
>
>
> ValueCD WebMaster wrote:
>
> > I am having a heck of a hard time with the following
> > problem:
> >
> > I'm trying to use CURL to fetch me product pages from a
> > public e-commerce site based on UPC search
> (=bar code). The
> > appropriate HTML form exists on the site, and
> in a regular
> > browser (Internet Explorer) it works just fine:
> >
> >
> http://www.nl.bol.com/is-bin/INTERSHOP.enfinity/eC
> S/Store/nl
> >
> /-/EUR/BOL_ParametricSearch-Start;sid=GftHZ1xgP-BH
> QGG7IN2EIC
> >
> 5Ww0-7atG-Yew=?Section=MUSIC&orenge_quicksearch=tr
> ue&orenge_
> >
> quicksearch_subset=ean%7CEAN&search_query_keyword=
> 5099750800
> > 027
> >
> > This long URL displays "Bruce Springsteen: The
> Rising" page
> > IN A BROWSER.
> >
> > However, when I try to get the very same page
> by CURL from
> > the command line:
> >
> > curl -A
> > Mozilla/4.0+[en]+(compatible;+MSIE+6.01;+Windows+XP) -o
> > local_page.htm
> >
> "http://www.nl.bol.com/is-bin/INTERSHOP.enfinity/e
> CS/Store/n
> >
> l/-/EUR/BOL_ParametricSearch-Start;sid=GftHZ1xgP-B
> HQGG7IN2EI
> >
> C5Ww0-7atG-Yew=?Section=MUSIC&orenge_quicksearch=t
> rue&orenge
> >
> _quicksearch_subset=ean%7CEAN&search_query_keyword
> =509975080
> > 0027"
> >
> > the server returns a page saying in so many
> words 'NO MATCH
> > FOUND".
> >
> > Meaning CURL fetches a totally different page
> for the very
> > same URL than a regular browser. Quite clearly,
> something is
> > either missing or incorrect in my syntax.
> >
> > I've spend hours trying to figure out where the
> problem is,
> > with no success. The site is public so there are no
> > passwords or anything.
> >
> > I made CURL to send the same browser signature
> my browser
> > has (with the -A option); no difference. I think it is
> > possibly cookie-related, but I've tried to capture the
> > header into a file first (with the -D option)
> and then send
> > it with the subsequent request (with the -b option); no
> > difference. I've tried the -L option if perhaps
> the page is
> > redirected, no go either.
> >
> > I'm increasingly desperate. Can please someone
> "show me the
> > light" before I lose my mind?
> > Thank you very much!!
> >
> > (Note: The URLs are very long so your e-mail client may
> > display them broken down to several lines; in
> that case you
> > need to assemble each in a single URL before
> using them.)
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
>
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-12-07