Re: Loading cookies that were set by Javascript

2007-05-17 Thread Hrvoje Niksic
"George Pavlov" <[EMAIL PROTECTED]> writes:

>> > Permanent cookies are supposed to be present in cookies.txt, and
>> > Wget will use them.  Session cookies will be missing (regardless
>> > of how they were set) from the file and therefore will not be
>> > picked up by Wget.
>
> This is not entirely true. You can use "--keep-session-cookies"

What I meant is that the session cookies will not be saved by the
browser to cookies.txt, regardless of whether they were set by the
server or by Javascript.  I was assuming the OP was already using a
browser-created cookies.txt.


RE: Loading cookies that were set by Javascript

2007-05-17 Thread George Pavlov
> I actually do know the cookies that are set. What I'd
> like to do is add it to cookies.txt. I attempted to
> edit the file, but when I load the cookies, the ones
> I've added doesn't show. It only shows the ones saved
> by wget. I'm not even sure what the format of the
> cookies is supposed to be.

Note that some browsers (not IE though) save their cookies in a
plain-text cookies file so nothing prevents you from also pointing
directly to, say, Firefox's cookies file, e.g. (this is on Windows but
using cygwin):

wget \
  --load-cookies /cygdrive/c/Documents\ and\
Settings/someuser/Application\
Data/Mozilla/Firefox/Profiles/99jf7fti.default/cookies.txt \
  "http://www.yourtargetwebsite.com";

Even if you don't use that file, examining it and pointing to it is very
informative for understanding what the cookies look like.

> > Permanent cookies are supposed
> > to be present in
> > cookies.txt, and Wget will use them.  Session
> > cookies will be missing
> > (regardless of how they were set) from the file and
> > therefore will not be picked up by Wget.

This is not entirely true. You can use "--keep-session-cookies" and save
the session cookies as well as the regular cookies for reuse by
subsequent wget calls, e.g., supposing you have a site that sets a
session cookie after an authenticated login:

wget \
  --save-cookies cookies.txt \
  --keep-session-cookies \
  --post-data '[EMAIL PROTECTED]&password=your_password'
\
  "http://www.yourtargetwebsite.com/login_page";

After this your wget invocations can use the cookies.txt and you will be
a logged in user.

George




Re: Loading cookies that were set by Javascript

2007-05-16 Thread Poppa Pump
Awesome. Thank you for all your help.

--- Hrvoje Niksic <[EMAIL PROTECTED]> wrote:

> Poppa Pump <[EMAIL PROTECTED]> writes:
> 
> > I actually do know the cookies that are set. What
> I'd like to do is
> > add it to cookies.txt. I attempted to edit the
> file, but when I load
> > the cookies, the ones I've added doesn't show. It
> only shows the
> > ones saved by wget. I'm not even sure what the
> format of the cookies
> > is supposed to be.
> 
> The format is fairly simple.  For a non-SSL cookie
> it would be:
> 
> web.site.com  FALSE   /   FALSE   1210581521  namevalue
> 
> "name" and "value" are the name and the value of the
> cookie, and
> 1210581521 is a timestamp approximately one year in
> the future.  The
> columns are TAB-delimited.
> 



 

8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news


Re: Loading cookies that were set by Javascript

2007-05-16 Thread Hrvoje Niksic
Poppa Pump <[EMAIL PROTECTED]> writes:

> I actually do know the cookies that are set. What I'd like to do is
> add it to cookies.txt. I attempted to edit the file, but when I load
> the cookies, the ones I've added doesn't show. It only shows the
> ones saved by wget. I'm not even sure what the format of the cookies
> is supposed to be.

The format is fairly simple.  For a non-SSL cookie it would be:

web.site.comFALSE   /   FALSE   1210581521  namevalue

"name" and "value" are the name and the value of the cookie, and
1210581521 is a timestamp approximately one year in the future.  The
columns are TAB-delimited.


Re: Loading cookies that were set by Javascript

2007-05-16 Thread Poppa Pump
I actually do know the cookies that are set. What I'd
like to do is add it to cookies.txt. I attempted to
edit the file, but when I load the cookies, the ones
I've added doesn't show. It only shows the ones saved
by wget. I'm not even sure what the format of the
cookies is supposed to be.

--- Hrvoje Niksic <[EMAIL PROTECTED]> wrote:

> Poppa Pump <[EMAIL PROTECTED]> writes:
> 
> > Now I also need to load 2 more cookie values, but
> these are set
> > using Javascript. Does anyone know how to set
> those cookies. I can't
> > seem to find any info on this. Thanks for your
> help.
> 
> Wget doesn't really distinguish the cookies set by
> Javascript from
> those set otherwise.  Permanent cookies are supposed
> to be present in
> cookies.txt, and Wget will use them.  Session
> cookies will be missing
> (regardless of how they were set) from the file and
> therefore will not
> be picked up by Wget.
> 
> If you know which cookies the site is adding, and
> you can check that
> using your browser's cookie manager, you can always
> add them manually
> to cookies.txt and rerun Wget.
> 



   
Be
 a better Globetrotter. Get better travel answers from someone who knows. 
Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469


Re: Loading cookies that were set by Javascript

2007-05-16 Thread Hrvoje Niksic
Poppa Pump <[EMAIL PROTECTED]> writes:

> Now I also need to load 2 more cookie values, but these are set
> using Javascript. Does anyone know how to set those cookies. I can't
> seem to find any info on this. Thanks for your help.

Wget doesn't really distinguish the cookies set by Javascript from
those set otherwise.  Permanent cookies are supposed to be present in
cookies.txt, and Wget will use them.  Session cookies will be missing
(regardless of how they were set) from the file and therefore will not
be picked up by Wget.

If you know which cookies the site is adding, and you can check that
using your browser's cookie manager, you can always add them manually
to cookies.txt and rerun Wget.


Re: Loading cookies that were set by Javascript

2007-05-15 Thread Steven M. Schweda
From: Poppa Pump

> [...] but these are set using Javascript. [...]

   Wget doesn't do JavaScript.  I suspect that you're doomed.



   Steven M. Schweda   [EMAIL PROTECTED]
   382 South Warwick Street(+1) 651-699-9818
   Saint Paul  MN  55105-2547