<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; VBS: Проверка слова на странице и воспроизведение звука]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=6344</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6344&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «VBS: Проверка слова на странице и воспроизведение звука».]]></description>
		<lastBuildDate>Fri, 21 Oct 2011 04:33:13 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: VBS: Проверка слова на странице и воспроизведение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=52756#p52756</link>
			<description><![CDATA[<p>Огромное спасибо, всё работает <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Dizzy221)]]></author>
			<pubDate>Fri, 21 Oct 2011 04:33:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=52756#p52756</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Проверка слова на странице и воспроизведение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=52748#p52748</link>
			<description><![CDATA[<p>Воспроизвести звук вместо MsgBox можно, например, так<br /></p><div class="codebox"><pre><code>IE.Document.appendChild(IE.Document.createElement(&quot;BGSOUND&quot;)).src = &quot;C:\WINDOWS\Media\tada.wav&quot;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (shiz)]]></author>
			<pubDate>Thu, 20 Oct 2011 22:14:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=52748#p52748</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Проверка слова на странице и воспроизведение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=52746#p52746</link>
			<description><![CDATA[<p><strong>Mickey666x</strong>, не надёжней ли вместо document.body.innerHTML использовать очищенный от разметки document.body.innerText и не проще ли не записывать его во внешний файл, а сразу применить к нему функцию InStr?<br />Т.е заменить<br /></p><div class="codebox"><pre><code>    Set File = FSO.CreateTextFile(&quot;C:\Documents.html&quot;)  &#039;Путь создания HTML
    file.Write(IE.document.body.innerhtml)
    file.Close
    Set File = FSO.OpenTextFile(&quot;C:\Documents.html&quot;, 1, False)    &#039;Чтение
    Do While File.AtEndOfStream &lt;&gt; True
        Txt = File.ReadLine
        
        If InStr(Txt, &quot;Слово&quot;) &gt; 0 Then    &#039;Здесь Слово
            MsgBox &quot;Найдено!&quot;,vbInformation,&quot;Internet Explorer&quot;
            Exit Do
        End If
        
    Loop
    File.Close</code></pre></div><p>на<br /></p><div class="codebox"><pre><code>    If InStr(IE.Document.body.innerText, &quot;Слово&quot;) &gt; 0 Then    &#039;Здесь Слово
        MsgBox &quot;Найдено!&quot;, vbInformation, WScript.ScriptName
    End If</code></pre></div><p>---<br />И вот это:<br /></p><div class="codebox"><pre><code>Dim Down
&#039;...
    While Down = False
        WScript.Sleep 200
    Wend
    Down = False
&#039;...
Sub IE_DocumentComplete(pDisp, URL)
    Down = True    
End Sub</code></pre></div><p>по-моему понятней (я не сразу сообразил, что за Down) сделать как<br /></p><div class="codebox"><pre><code>    While IE.Busy
        WScript.Sleep 200
    Wend</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (shiz)]]></author>
			<pubDate>Thu, 20 Oct 2011 21:38:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=52746#p52746</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Проверка слова на странице и воспроизведение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=52743#p52743</link>
			<description><![CDATA[<div class="codebox"><pre><code>Dim FSO
Dim IE
Dim Down
Dim File
Dim Txt
Set FSO=CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set IE = WScript.CreateObject(&quot;InternetExplorer.Application&quot;, &quot;IE_&quot;)
IE.Visible = True
Do
    IE.Navigate (&quot;http://www.yandex.ru/&quot;)        &#039;URL ресурса
    While Down = False
        WScript.Sleep 200
    Wend
    Down = False
    Set File = FSO.CreateTextFile(&quot;C:\Documents.html&quot;)  &#039;Путь создания HTML
    file.Write(IE.document.body.innerhtml)
    file.Close
    Set File = FSO.OpenTextFile(&quot;C:\Documents.html&quot;, 1, False)    &#039;Чтение
    Do While File.AtEndOfStream &lt;&gt; True
        Txt = File.ReadLine
        
        If InStr(Txt, &quot;Слово&quot;) &gt; 0 Then    &#039;Здесь Слово
            MsgBox &quot;Найдено!&quot;,vbInformation,&quot;Internet Explorer&quot;
            Exit Do
        End If
        
    Loop
    File.Close
    Wscript.Sleep 5000        &#039;Время в милисекундах, через которое обновляется страница
Loop

Sub IE_DocumentComplete(pDisp, URL)
    Down = True    
End Sub

Sub IE_OnQuit()
    WScript.Quit
End Sub</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Mickey666x)]]></author>
			<pubDate>Thu, 20 Oct 2011 19:26:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=52743#p52743</guid>
		</item>
		<item>
			<title><![CDATA[VBS: Проверка слова на странице и воспроизведение звука]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=52739#p52739</link>
			<description><![CDATA[<p>Здравствуйте, форумчане.<br />Помогите написать следующее:<br />В браузере открыта страница, которая обнавляется каждые 5 секунд.<br />После каждого обновления производиться проверка есть на странице определенное слово (Пусть это слово будет &quot;Слово&quot;).<br />Если его нет то ничего не просходит, а идет всё дальше. <br />Но если есть, то запускается звуковой файл (любой).</p>]]></description>
			<author><![CDATA[null@example.com (Dizzy221)]]></author>
			<pubDate>Thu, 20 Oct 2011 16:25:55 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=52739#p52739</guid>
		</item>
	</channel>
</rss>
