<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; Логин на сайте с wget]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=10390&amp;type=atom" />
	<updated>2011-01-27T09:30:10Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=10390</id>
		<entry>
			<title type="html"><![CDATA[Re: Логин на сайте с wget]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=137242#p137242" />
			<content type="html"><![CDATA[<p><strong>drBatty</strong><br />Работает smile <br />Ещё раз спасибо!</p>]]></content>
			<author>
				<name><![CDATA[Shtirlitc]]></name>
				<uri>https://linuxforum.ru/profile.php?id=13508</uri>
			</author>
			<updated>2011-01-27T09:30:10Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=137242#p137242</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Логин на сайте с wget]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=137221#p137221" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Shtirlitc пишет:</cite><blockquote><p>Проверяю.</p></blockquote></div><p>это лишнее. УМВР <img src="https://linuxforum.ru/img/smilies/bx.gif" alt="bx" /></p>]]></content>
			<author>
				<name><![CDATA[drBatty]]></name>
				<uri>https://linuxforum.ru/profile.php?id=86</uri>
			</author>
			<updated>2011-01-27T08:44:57Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=137221#p137221</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Логин на сайте с wget]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=137218#p137218" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>drBatty пишет:</cite><blockquote><p><strong>Shtirlitc</strong>, <a href="http://forum.drbatty.ru/viewtopic.php?f=77&amp;t=5215">http://forum.drbatty.ru/viewtopic.php?f=77&amp;t=5215</a><br />не?</p></blockquote></div><p>Похоже на то что нужно, спасибо. Проверяю.</p>]]></content>
			<author>
				<name><![CDATA[Shtirlitc]]></name>
				<uri>https://linuxforum.ru/profile.php?id=13508</uri>
			</author>
			<updated>2011-01-27T08:38:38Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=137218#p137218</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Логин на сайте с wget]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=137177#p137177" />
			<content type="html"><![CDATA[<p><strong>Shtirlitc</strong>, <a href="http://forum.drbatty.ru/viewtopic.php?f=77&amp;t=5215">http://forum.drbatty.ru/viewtopic.php?f=77&amp;t=5215</a><br />не?</p>]]></content>
			<author>
				<name><![CDATA[drBatty]]></name>
				<uri>https://linuxforum.ru/profile.php?id=86</uri>
			</author>
			<updated>2011-01-27T07:11:53Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=137177#p137177</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Логин на сайте с wget]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=137168#p137168" />
			<content type="html"><![CDATA[<p>Доброго времени суток.<br />Есть задача: <br />1) залогиниться на сайте из sh скрипта через wget<br />2) выставить 5 селектов в определенное положение и кликнуть по submit button.<br />Данные передаются POST. С первой задачей справились успешно:<br /></p><div class="codebox"><pre><code>wget --keep-session-cookies --save-cookies cookies.txt --post-data &#039;username=$USER&amp;password=$PASS&amp;submit=1&#039; http://url.ru/admin/login.php</code></pre></div><p>Куки сохраняются в файл cookies.txt , содержимое файла:<br /></p><div class="quotebox"><blockquote><p># HTTP cookie file.<br /># Generated by Wget on 2011-01-27 12:23:07.<br /># Edit at your own risk.</p><p>url.ru&nbsp; &nbsp; &nbsp;FALSE&nbsp; &nbsp;/&nbsp; &nbsp; &nbsp; &nbsp;FALSE&nbsp; &nbsp;0&nbsp; &nbsp; &nbsp; &nbsp;ps_sess_id&nbsp; &nbsp; &nbsp; fd6c1bcabaf36e6eee8c9785afbe474a</p></blockquote></div><p>Далее пытаемся зайти на нужную страницу и выполнить необходимые действия, используя сохранённые куки:<br /></p><div class="codebox"><pre><code>wget --load-cookies cookies.txt --post-data &#039;player_profiles=1&amp;player_aliases=1&amp;player_bans=1&amp;clan_profiles=1&amp;users=1&amp;submit=1&#039; -p http://url.ru/admin/reset.php</code></pre></div><p>В ответ получаем:<br /></p><div class="codebox"><pre><code>--12:26:37--  http://url.ru/admin/reset.php
           =&gt; `url.ru/admin/reset.php&#039;
Resolving url.ru... 10.5.255.20
Connecting to url.ru|10.5.255.20|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: /admin/login.php?ref=%2Fgames%2Fcs_monthly%2Fadmin%2Freset.php [following]
--12:26:37--  http://url.ru/admin/login.php?ref=%2Fgames%2Fcs_monthly%2Fadmin%2Freset.php
           =&gt; `url.ru/admin/login.php?ref=%2Fgames%2Fcs_monthly%2Fadmin%2Freset.php&#039;
Connecting to url.ru|10.5.255.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3,706 (3.6K) [text/html]

100%[=================================================================================================================&gt;] 3,706         --.--K/s

12:26:37 (190.23 MB/s) - `url.ru/admin/login.php?ref=%2Fgames%2Fcs_monthly%2Fadmin%2Freset.php&#039; saved [3706/3706]

Loading robots.txt; please ignore errors.
--12:26:37--  http://url.ru/robots.txt
           =&gt; `url.ru/robots.txt&#039;
Reusing existing connection to url.ru:80.
HTTP request sent, awaiting response... 302 Found
Location: http://core.url.ru/errors/404/ [following]
--12:26:37--  http://core.url.ru/errors/404/
           =&gt; `core.url.ru/errors/404/index.html&#039;
Resolving core.url.ru... 190.238.131.200
Connecting to core.url.ru|190.238.131.200|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

    [ &lt;=&gt;                                                                                                              ] 1,330         --.--K/s

12:26:37 (174.61 MB/s) - `core.url.ru/errors/404/index.html&#039; saved [1330]

--12:26:37--  http://url.ru/admin/themes/acp/css/overall.css
           =&gt; `url.ru/admin/themes/acp/css/overall.css&#039;
Connecting to url.ru|10.5.255.20|:80... connected.
HTTP request sent, awaiting response... 405 Not Allowed
12:26:37 ERROR 405: Not Allowed.

--12:26:37--  http://url.ru/admin/themes/acp/css/content.css
           =&gt; `url.ru/admin/themes/acp/css/content.css&#039;
Reusing existing connection to url.ru:80.
HTTP request sent, awaiting response... 405 Not Allowed
12:26:37 ERROR 405: Not Allowed.

--12:26:37--  http://url.ru/admin/themes/acp/css/forms.css
           =&gt; `url.ru/admin/themes/acp/css/forms.css&#039;
Reusing existing connection to url.ru:80.
HTTP request sent, awaiting response... 405 Not Allowed
12:26:37 ERROR 405: Not Allowed.

--12:26:37--  http://url.ru/admin/themes/acp/js/jquery.js
           =&gt; `url.ru/admin/themes/acp/js/jquery.js&#039;
Reusing existing connection to url.ru:80.
HTTP request sent, awaiting response... 405 Not Allowed
12:26:37 ERROR 405: Not Allowed.

--12:26:37--  http://url.ru/admin/themes/acp/js/overall.js
           =&gt; `url.ru/admin/themes/acp/js/overall.js&#039;
Reusing existing connection to url.ru:80.
HTTP request sent, awaiting response... 405 Not Allowed
12:26:37 ERROR 405: Not Allowed.

--12:26:37--  http://url.ru/admin/themes/acp/js/forms.js
           =&gt; `url.ru/admin/themes/acp/js/forms.js&#039;
Reusing existing connection to url.ru:80.
HTTP request sent, awaiting response... 405 Not Allowed
12:26:38 ERROR 405: Not Allowed.

--12:26:38--  http://url.ru/admin/themes/acp/js/login.js
           =&gt; `url.ru/admin/themes/acp/js/login.js&#039;
Reusing existing connection to url.ru:80.
HTTP request sent, awaiting response... 405 Not Allowed
12:26:38 ERROR 405: Not Allowed.</code></pre></div><p>Исходя из ошибок вида ERROR 405: Not Allowed возникает ощущение что wget не считывает/не передаёт сохранённые куки из файла cookies.txt<br />Кто нибудь сталкивался ? Какие есть идеи? В каком направлении рыть?</p>]]></content>
			<author>
				<name><![CDATA[Shtirlitc]]></name>
				<uri>https://linuxforum.ru/profile.php?id=13508</uri>
			</author>
			<updated>2011-01-27T06:35:09Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=137168#p137168</id>
		</entry>
</feed>
