<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Получение текста с ссылки в фоновом режиме.]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14866&amp;type=atom" />
	<updated>2019-07-18T21:58:11Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14866</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение текста с ссылки в фоновом режиме.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134937#p134937" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Огромное спасибо.</p>]]></content>
			<author>
				<name><![CDATA[Ms_Smail]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39022</uri>
			</author>
			<updated>2019-07-18T21:58:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134937#p134937</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение текста с ссылки в фоновом режиме.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134936#p134936" />
			<content type="html"><![CDATA[<p>Не совсем понял вопрос. Какой именно «этот»?<br /><a href="https://docs.microsoft.com/en-us/windows/win32/winhttp/winhttprequest">WinHttpRequest object</a><br />Если про htmlfile, то тут немного сложнее: <a href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa752574(v=vs.85)">IHTMLDocument2 interface</a>, для начала лучше смотреть примеры применения на нашем или на официальном форумах.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-18T21:52:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134936#p134936</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение текста с ссылки в фоновом режиме.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134934#p134934" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />А у вас не найдётся источника где можно подробнее изучить этот способ работы с ссылками? Буду очень благодарен.</p>]]></content>
			<author>
				<name><![CDATA[Ms_Smail]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39022</uri>
			</author>
			<updated>2019-07-18T21:43:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134934#p134934</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение текста с ссылки в фоновом режиме.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134929#p134929" />
			<content type="html"><![CDATA[<p>Или так:<br /></p><div class="codebox"><pre><code>RegExMatch(html, &quot;Пользователей:.*?\K[\d,]+&quot;, users)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-18T20:40:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134929#p134929</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение текста с ссылки в фоновом режиме.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134928#p134928" />
			<content type="html"><![CDATA[<p>Иногда можно применить RegEx вместо htmlfile:<br /></p><div class="codebox"><pre><code>url := &quot;http://forum.script-coding.com/index.php&quot;

whr := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
whr.Open(&quot;GET&quot;, url, false)
whr.Send()
html := whr.ResponseText

RegExMatch(html, &quot;Пользователей:\s*&lt;strong&gt;\K[^&lt;]+&quot;, users)
MsgBox, % users</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-18T20:35:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134928#p134928</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение текста с ссылки в фоновом режиме.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134927#p134927" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Спасибо! Это гораздо быстрее.</p>]]></content>
			<author>
				<name><![CDATA[Ms_Smail]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39022</uri>
			</author>
			<updated>2019-07-18T20:30:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134927#p134927</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение текста с ссылки в фоновом режиме.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134925#p134925" />
			<content type="html"><![CDATA[<p>Например, нужно получить количество пользователей с главной страницы этого сайта:</p><p><span class="postimg"><img src="https://i.imgur.com/BL42U2w.png" alt="https://i.imgur.com/BL42U2w.png" /></span></p><p>html:</p><p><span class="postimg"><img src="https://i.imgur.com/rIMnt3v.png" alt="https://i.imgur.com/rIMnt3v.png" /></span></p><div class="codebox"><pre><code>url := &quot;http://forum.script-coding.com/index.php&quot;

whr := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
whr.Open(&quot;GET&quot;, url, false)
whr.Send()
html := whr.ResponseText

doc := ComObjCreate(&quot;htmlfile&quot;)
doc.write(&quot;&lt;meta http-equiv=&quot;&quot;X-UA-Compatible&quot;&quot; content=&quot;&quot;IE=9&quot;&quot;&gt;&quot;)
doc.write(html)

elem := doc.querySelector(&quot;.st-users &gt; span &gt; strong&quot;)
MsgBox, % elem.innerText</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-18T20:26:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134925#p134925</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение текста с ссылки в фоновом режиме.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134918#p134918" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Вы не поняли, там описан метод через Explorer, а меня интересует, если ли какой-нибудь другой.<br />Спасибо за ссылку, нашёл кое-что новое для себя.</p>]]></content>
			<author>
				<name><![CDATA[Ms_Smail]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39022</uri>
			</author>
			<updated>2019-07-18T20:06:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134918#p134918</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение текста с ссылки в фоновом режиме.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134916#p134916" />
			<content type="html"><![CDATA[<p>Читайте <a href="https://learn.javascript.ru/searching-elements-dom">здесь</a>.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-18T19:51:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134916#p134916</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Получение текста с ссылки в фоновом режиме.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134912#p134912" />
			<content type="html"><![CDATA[<p>Здравствуйте. Нужно получать текст с разных ссылок.<br />Вот часть кода элемента с сайта:<br /></p><div class="codebox"><pre><code>
...
&lt;div class=&quot;price-block&quot;&gt;
&lt;span&gt;167&lt;/span&gt;
...
</code></pre></div><p>Для меня известен только один способ получения текста с ссылок. В данный момент мне нужно получить число 167.</p><p>Я делаю это следующим образом:<br /></p><div class="codebox"><pre><code>
ie := ComObjCreate(&quot;InternetExplorer.Application&quot;)
ie.Visible := false
ie.Navigate(&quot;ссылка на этот сайт&quot;)
while ie.readystate &lt;&gt; 4 
{
continue 
}
Text := ie.document.getElementsByClassName(&quot;price-block&quot;)[0].innerText
</code></pre></div><p>Меня бы устроил и этот вариант, но нужно проверить много ссылок, а этот метод медлителен. Существует ли какой-нибудь другой способ получить текст по классу,id, и т.д. элемента?</p>]]></content>
			<author>
				<name><![CDATA[Ms_Smail]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39022</uri>
			</author>
			<updated>2019-07-18T19:14:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134912#p134912</id>
		</entry>
</feed>
