<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: Проверка слова на странице и воспроизведение звука]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6344&amp;type=atom" />
	<updated>2011-10-21T04:33:13Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6344</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Проверка слова на странице и воспроизведение звука]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=52756#p52756" />
			<content type="html"><![CDATA[<p>Огромное спасибо, всё работает <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Dizzy221]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26614</uri>
			</author>
			<updated>2011-10-21T04:33:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=52756#p52756</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Проверка слова на странице и воспроизведение звука]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=52748#p52748" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[shiz]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26249</uri>
			</author>
			<updated>2011-10-20T22:14:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=52748#p52748</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Проверка слова на странице и воспроизведение звука]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=52746#p52746" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[shiz]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26249</uri>
			</author>
			<updated>2011-10-20T21:38:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=52746#p52746</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Проверка слова на странице и воспроизведение звука]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=52743#p52743" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Mickey666x]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26846</uri>
			</author>
			<updated>2011-10-20T19:26:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=52743#p52743</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS: Проверка слова на странице и воспроизведение звука]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=52739#p52739" />
			<content type="html"><![CDATA[<p>Здравствуйте, форумчане.<br />Помогите написать следующее:<br />В браузере открыта страница, которая обнавляется каждые 5 секунд.<br />После каждого обновления производиться проверка есть на странице определенное слово (Пусть это слово будет &quot;Слово&quot;).<br />Если его нет то ничего не просходит, а идет всё дальше. <br />Но если есть, то запускается звуковой файл (любой).</p>]]></content>
			<author>
				<name><![CDATA[Dizzy221]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26614</uri>
			</author>
			<updated>2011-10-20T16:25:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=52739#p52739</id>
		</entry>
</feed>
