LINUX.ORG.RU

Получить cookies с помощью wget.

 , ,


0

3

Пытаюсь получить cookies с этого сайта командой

wget --save-cookies cookies --post-data 'username=prosto&password=111111' https://learningapps.org/login.php
но получаю только пустой файл cookies(только закомментированные строки в нём). В чём проблема?


В общей неграмотности и ленивости. man wget:

...
       --save-cookies file
           Save cookies to file before exiting.  This will not save cookies
           that have expired or that have no expiry time (so-called «session
           cookies»), but also see --keep-session-cookies.

       --keep-session-cookies
           When specified, causes --save-cookies to also save session cookies.
           Session cookies are normally not saved because they are meant to be
           kept in memory and forgotten when you exit the browser.  Saving
           them is useful on sites that require you to log in or to visit the
           home page before you can access some pages.  With this option,
           multiple Wget runs are considered a single browser session as far
           as the site is concerned.

           Since the cookie file format does not normally carry session
           cookies, Wget marks them with an expiry timestamp of 0.  Wget's
           --load-cookies recognizes those as session cookies, but it might
           confuse other browsers.  Also note that cookies so loaded will be
           treated as other session cookies, which means that if you want
           --save-cookies to preserve them again, you must use
           --keep-session-cookies again.
arto ★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.