<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Получение данных со страницы сайта в переменную]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=9681</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9681&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Получение данных со страницы сайта в переменную».]]></description>
		<lastBuildDate>Sat, 07 Jun 2014 13:51:01 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83737#p83737</link>
			<description><![CDATA[<p>Ну, если нужен универсальный код, то надо узнавать. Странно вообще-то, что там выше cp1252 сработало. Если русские буквы, то должно быть cp1251.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sat, 07 Jun 2014 13:51:01 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83737#p83737</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83736#p83736</link>
			<description><![CDATA[<p>Тогда здесь крякозябры <span class="bbu">Url = http://www.microsoft.com</span>.<br />Может как то так узнавать кодировку:<br /></p><div class="codebox"><pre><code>
Url = http://site.ru/file.txt
Url = http://www.script-coding.com/WSH.html
Url = http://www.microsoft.com
 
HTTP := ComObjCreate(&quot;WinHTTP.WinHTTPRequest.5.1&quot;) 
HTTP.Open(&quot;GET&quot;, Url) 
HTTP.Send()   

Body := HTTP.ResponseBody
pArr := ComObjValue(Body)
cBytes := NumGet(pArr+0, A_PtrSize = 8? 24:16, &quot;uint&quot;)
pText := NumGet(pArr+0, A_PtrSize = 8? 16:12, &quot;ptr&quot;) 

RegexMatch(HTTP.ResponseText, &quot;`nmi)&lt;meta.*?charset=&quot;&quot;*(?&lt;Set&gt;.*?)&quot;&quot;.*?&gt;&quot;, Char)   
Encode := CharSet = &quot;windows-1251&quot; ? &quot;cp1251&quot; : CharSet

MsgBox, % StrGet(pText, cBytes, Encode)
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 07 Jun 2014 13:12:10 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83736#p83736</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83732#p83732</link>
			<description><![CDATA[<div class="quotebox"><cite>YMP пишет:</cite><blockquote><p>А если так?<br /></p><div class="codebox"><pre><code>
HTTP := ComObjCreate(&quot;WinHTTP.WinHTTPRequest.5.1&quot;)
HTTP.Open(&quot;GET&quot;, &quot;http://site.ru/file.txt&quot;)
HTTP.Send()
Body := HTTP.ResponseBody
pArr := ComObjValue(Body)
cBytes := NumGet(pArr+0, A_PtrSize = 8? 24:16, &quot;uint&quot;)
pText := NumGet(pArr+0, A_PtrSize = 8? 16:12, &quot;ptr&quot;)
MsgBox, % StrGet(pText, cBytes, &quot;cp1252&quot;)
</code></pre></div></blockquote></div><p>Ты великолепен! Все работает как надо! Спасибо большое!</p>]]></description>
			<author><![CDATA[null@example.com (tuma4ok)]]></author>
			<pubDate>Sat, 07 Jun 2014 12:30:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83732#p83732</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83731#p83731</link>
			<description><![CDATA[<p>А если так?<br /></p><div class="codebox"><pre><code>
HTTP := ComObjCreate(&quot;WinHTTP.WinHTTPRequest.5.1&quot;)
HTTP.Open(&quot;GET&quot;, &quot;http://site.ru/file.txt&quot;)
HTTP.Send()
Body := HTTP.ResponseBody
pArr := ComObjValue(Body)
cBytes := NumGet(pArr+0, A_PtrSize = 8? 24:16, &quot;uint&quot;)
pText := NumGet(pArr+0, A_PtrSize = 8? 16:12, &quot;ptr&quot;)
MsgBox, % StrGet(pText, cBytes, &quot;cp1252&quot;)
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sat, 07 Jun 2014 12:22:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83731#p83731</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83730#p83730</link>
			<description><![CDATA[<p>Вот такие иероглифы. Если поможет, вот ссылка на файл <a href="http://vkontackte.tk/NoDelete/base.php">http://vkontackte.tk/NoDelete/base.php</a></p>]]></description>
			<author><![CDATA[null@example.com (tuma4ok)]]></author>
			<pubDate>Sat, 07 Jun 2014 12:17:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83730#p83730</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83729#p83729</link>
			<description><![CDATA[<div class="quotebox"><cite>tuma4ok пишет:</cite><blockquote><p>Ни что из выше сказанных не помогло! Либо ничего нету, либо опять иероглифы.</p></blockquote></div><p>Какие именно иероглифы? Показать можете?</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sat, 07 Jun 2014 12:02:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83729#p83729</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83728#p83728</link>
			<description><![CDATA[<p>Дело в том, что здесь:<br /></p><div class="codebox"><pre><code>
HTTP := ComObjCreate(&quot;WinHTTP.WinHTTPRequest.5.1&quot;)
HTTP.Open(&quot;GET&quot;, &quot;http://site.ru/file.txt&quot;)
HTTP.Send()
MsgBox, % HTTP.ResponseText
</code></pre></div><p>у меня нормальные русские буквы.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 07 Jun 2014 11:48:07 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83728#p83728</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83727#p83727</link>
			<description><![CDATA[<p>Ни что из выше сказанных не помогло! Либо ничего нету, либо опять иероглифы.</p>]]></description>
			<author><![CDATA[null@example.com (tuma4ok)]]></author>
			<pubDate>Sat, 07 Jun 2014 11:43:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83727#p83727</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83726#p83726</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>По какой например ссылке.</p></blockquote></div><p>По такой же.</p>]]></description>
			<author><![CDATA[null@example.com (tuma4ok)]]></author>
			<pubDate>Sat, 07 Jun 2014 11:39:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83726#p83726</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83725#p83725</link>
			<description><![CDATA[<p>Вот у меня тоже что-то не получается.<br />Что упустил?<br /></p><div class="codebox"><pre><code>HTTP := ComObjCreate(&quot;WinHTTP.WinHTTPRequest.5.1&quot;)
HTTP.Open(&quot;GET&quot;, &quot;https://trust-host.ru/&quot;)
HTTP.SetRequestHeader(&quot;Accept-Language&quot;, &quot;ru&quot;)
HTTP.SetRequestHeader(&quot;Accept-Charset&quot;,&quot;Windows-1251&quot;)
HTTP.setRequestHeader(&quot;Content-Language&quot;, &quot;ru&quot;)
HTTP.setRequestHeader(&quot;Content-Charset&quot;, &quot;Windows-1251&quot;)
HTTP.setRequestHeader(&quot;Content-Type&quot;,&quot;application/x-www-form-urlencoded; charset=Windows-1251&quot;)
HTTP.Send()
MsgBox, % HTTP.ResponseText</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sat, 07 Jun 2014 11:09:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83725#p83725</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83724#p83724</link>
			<description><![CDATA[<p>Проблема в кодировке, видимо. Не знаю, можно ли её как-то явно задать. А &quot;через дыру в заборе&quot; можно так (для кодировки utf-8):<br /></p><div class="codebox"><pre><code>
HTTP := ComObjCreate(&quot;WinHTTP.WinHTTPRequest.5.1&quot;)
HTTP.Open(&quot;GET&quot;, &quot;http://site.ru/file.txt&quot;)
HTTP.Send()
Body := HTTP.ResponseBody
pArr := ComObjValue(Body)
cBytes := NumGet(pArr+0, A_PtrSize = 8? 24:16, &quot;uint&quot;)
pText := NumGet(pArr+0, A_PtrSize = 8? 16:12, &quot;ptr&quot;)
MsgBox, % StrGet(pText, cBytes, &quot;utf-8&quot;)
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sat, 07 Jun 2014 10:09:39 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83724#p83724</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83723#p83723</link>
			<description><![CDATA[<p>По какой например ссылке.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 07 Jun 2014 10:02:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83723#p83723</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83713#p83713</link>
			<description><![CDATA[<div class="quotebox"><cite>sergeiplugatyr пишет:</cite><blockquote><div class="codebox"><pre><code>HTTP := ComObjCreate(&quot;WinHTTP.WinHTTPRequest.5.1&quot;)
HTTP.Open(&quot;GET&quot;, &quot;http://site.ru/file.txt&quot;)
HTTP.Send()
MsgBox, % HTTP.ResponseText</code></pre></div></blockquote></div><p>Спасибо, помогло! Но появился новый вопрос, при получении русских букв, они становятся иероглифами, как это исправить?</p>]]></description>
			<author><![CDATA[null@example.com (tuma4ok)]]></author>
			<pubDate>Sat, 07 Jun 2014 09:00:23 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83713#p83713</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83703#p83703</link>
			<description><![CDATA[<div class="codebox"><pre><code>HTTP := ComObjCreate(&quot;WinHTTP.WinHTTPRequest.5.1&quot;)
HTTP.Open(&quot;GET&quot;, &quot;http://site.ru/file.txt&quot;)
HTTP.Send()
MsgBox, % HTTP.ResponseText</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (sergeiplugatyr)]]></author>
			<pubDate>Fri, 06 Jun 2014 18:48:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83703#p83703</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Получение данных со страницы сайта в переменную]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=83702#p83702</link>
			<description><![CDATA[<p>Здраствуйте, снова прошу помощи. Скажите пожалуйста как через WinHTTP получить весь текст со страницы в интернете? Ссылка имеет примерно такой вид: <strong>site.ru/file.txt</strong>, открывается текстовый документ. Напишите пожалуйста исходный код. Заранее спасибо.</p>]]></description>
			<author><![CDATA[null@example.com (tuma4ok)]]></author>
			<pubDate>Fri, 06 Jun 2014 17:04:45 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=83702#p83702</guid>
		</item>
	</channel>
</rss>
