cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Using curl to download CBOE csv file quotes...help!

From: <dsisk_at_nc.rr.com>
Date: Tue, 1 Feb 2011 9:53:49 -0500

Actually, CBOE apparently doesn't want people running automated scripts to download option quotes in CSV format...they've made it very convoluted and difficult to do from anything except a browser. That said, if I can somehow figure out exactly what a browser is doing behind the scenes, then I should be able to make curl "trick" it into thinking it's just a browser (right?). I'm a DBA and not a developer, but I think if I could somehow trap what the browser is doing behind the scenes then I could make curl do the same thing. Not exactly sure how to "trap" that though.

Any guidance here? This works easily with other sites (like Yahoo Finance for instance...but the only way to get an option chain from Yahoo is to return it as HTML, not CSV)...CBOE is a stubborn site!

TIA,
Dave

---- Ralph Mitchell <ralphmitchell_at_gmail.com> wrote:
> On Mon, Jan 31, 2011 at 2:13 PM, <dsisk_at_nc.rr.com> wrote:
>
> > Oh yeah, I've found the -c and -b cookie options...just not any example of
> > how to use them with this blasted CBOE site! ;-)
> >
> >
> Sigh - top-posting...
>
> I usually just put a standard set of curl options at the top of my scripts,
> then reference it later:
>
> CURLOPTS="-b cookies -c cookies -s -S -L -m 30"
> ...
> curl $CURLOPTS -o file.html http://server.domain.com/stuff/things/
>
> If the cookie file doesn't exist, it gets created, relevant cookies are sent
> to the host, all cookies are saved when curl exits.
>
> Ralph Mitchell
>
>
>
> > ---- Daniel Stenberg <daniel_at_haxx.se> wrote:
> > > On Sat, 29 Jan 2011, dsisk_at_nc.rr.com wrote:
> > >
> > > > So there are cookies involved. Doesn't curl support a way to pass
> > cookies
> > > > to a site? Any idea how to formulate the curl command with cookie data
> > in
> > > > this particular situation?
> > >
> > > Sure it does. Use -c to store them to a file and -b to read them from a
> > file.
> > >
> > > Surely searching for "cookie" in the man page would've found these...
> >

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-01