<?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=10291</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10291&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «VBS: Вытащить данные из динамичной таблицы».]]></description>
		<lastBuildDate>Thu, 01 Jan 2015 00:52:09 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89914#p89914</link>
			<description><![CDATA[<div class="quotebox"><cite>charony пишет:</cite><blockquote><p>да все прекрасно работает, остальное я запилю как мне нужно</p></blockquote></div><p>Ну, вот и славненько.</p><div class="quotebox"><cite>Flasher пишет:</cite><blockquote><p>Да. Quit - это не завершение программы, а закрытие объекта.</p></blockquote></div><p>Но вот у меня — завершает.</p>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Thu, 01 Jan 2015 00:52:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89914#p89914</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89913#p89913</link>
			<description><![CDATA[<div class="quotebox"><cite>alexii пишет:</cite><blockquote><p>Flasher, а нужен ли тогда «.Quit»?</p></blockquote></div><p>Да. Quit - это не завершение программы, а закрытие объекта.</p>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Wed, 31 Dec 2014 19:04:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89913#p89913</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89912#p89912</link>
			<description><![CDATA[<p>да все прекрасно работает, остальное я запилю как мне нужно<br />спасибо еще раз<br />буду рад поддержать через РР</p><br /><p>я еще спросить хотел<br />есть ли возможность получить тот же результат , через стандартные виндуфф dll?</p>]]></description>
			<author><![CDATA[null@example.com (charony)]]></author>
			<pubDate>Wed, 31 Dec 2014 18:54:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89912#p89912</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89911#p89911</link>
			<description><![CDATA[<div class="quotebox"><cite>charony пишет:</cite><blockquote><p>так?</p></blockquote></div><div class="quotebox"><cite>Flasher пишет:</cite><blockquote><p>Через :</p></blockquote></div><p>Или в две строки:</p><div class="codebox"><pre><code>    …
    SetLocale lngPrevLocale
    
    .ExecWB 45, 2
    .Quit
End With
…
</code></pre></div><p><strong>charony</strong>, так сработал «.ExecWB» или нет?</p><p><strong>Flasher</strong>, а нужен ли тогда «.Quit»?</p><div class="quotebox"><cite>charony пишет:</cite><blockquote><p>может у знакомых есть PayPal?</p></blockquote></div><p>У меня нет таких знакомых <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" />. Я спрошу завтра у <strong>atomix</strong>&#039;а — может, у него есть.</p>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Wed, 31 Dec 2014 17:52:39 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89911#p89911</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89909#p89909</link>
			<description><![CDATA[<p>много всем спасибо<br />и с наступающим</p>]]></description>
			<author><![CDATA[null@example.com (charony)]]></author>
			<pubDate>Wed, 31 Dec 2014 15:01:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89909#p89909</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89908#p89908</link>
			<description><![CDATA[<div class="quotebox"><cite>charony пишет:</cite><blockquote><p>так?</p></blockquote></div><p>Через :</p><div class="codebox"><pre><code>.ExecWB 45, 2 : .Quit</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Wed, 31 Dec 2014 14:59:23 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89908#p89908</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89907#p89907</link>
			<description><![CDATA[<p>@ alexii</p><p>может у знакомых есть PayPal?</p>]]></description>
			<author><![CDATA[null@example.com (charony)]]></author>
			<pubDate>Wed, 31 Dec 2014 14:49:19 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89907#p89907</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89906#p89906</link>
			<description><![CDATA[<div class="quotebox"><cite>Flasher пишет:</cite><blockquote><div class="quotebox"><cite>alexii пишет:</cite><blockquote><p>У меня на IE6 такого не наблюдается. Сожалею.</p></blockquote></div><p>А зачем сожалеть? Добавьте перед .Quit выход из программы <em>.ExecWB 45, 2</em> и всё.</p></blockquote></div><div class="codebox"><pre><code>
.ExecWB 45, 2 .Quit 
</code></pre></div><p>так?</p>]]></description>
			<author><![CDATA[null@example.com (charony)]]></author>
			<pubDate>Wed, 31 Dec 2014 14:39:26 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89906#p89906</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89905#p89905</link>
			<description><![CDATA[<p>много спасибо , все работает как нужно</p>]]></description>
			<author><![CDATA[null@example.com (charony)]]></author>
			<pubDate>Wed, 31 Dec 2014 14:26:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89905#p89905</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89903#p89903</link>
			<description><![CDATA[<p>Вообще-то с IE8 та же петрушка. А помочь можете указанной добавкой. <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Wed, 31 Dec 2014 14:12:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89903#p89903</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89902#p89902</link>
			<description><![CDATA[<p><strong>Flasher</strong>, сожалею, потому как не могу в этом помочь. Я даже теоретически не могу проверить на IE11, поскольку не на что его ставить. Вот тут Вам и карты в руки <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" />.</p>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Wed, 31 Dec 2014 14:09:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89902#p89902</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89901#p89901</link>
			<description><![CDATA[<div class="quotebox"><cite>alexii пишет:</cite><blockquote><p>У меня на IE6 такого не наблюдается. Сожалею.</p></blockquote></div><p>А зачем сожалеть? Добавьте перед .Quit выход из программы <em>.ExecWB 45, 2</em> и всё.</p>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Wed, 31 Dec 2014 13:48:20 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89901#p89901</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89900#p89900</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>IE не закрывается процесс после работы скрипта</p></blockquote></div><p>Как я понимаю, такое бывает. И не только при программном закрытии: <a href="http://answers.microsoft.com/en-us/ie/forum/ie9-windows_vista/after-closing-ie-windows-iexploreexe-processes-are/a3b1536d-1732-4f63-92d3-8fa927946d80">After closing IE windows iexplore.exe processes are still running - Microsoft Community</a>. У меня на IE6 такого не наблюдается. Сожалею.</p><div class="quotebox"><blockquote><p>первую строку , не нужно</p><p>первая строка должна начинаться с цифры</p><p>и если .12250В то 0.12250&nbsp; если .12030А то 0.123</p></blockquote></div><p>Пробуйте:<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>Option Explicit

Const READYSTATE_COMPLETE = 4


Dim strUrl

Dim objHTMLTableRow
Dim objHTMLTableCell

Dim SomeValue
Dim strContent

Dim lngPrevLocale

Dim strPath


strUrl = &quot;http://www.cmegroup.com/trading/fx/g10/euro-fx_quotes_settlements_options.html&quot;

With WScript.CreateObject(&quot;InternetExplorer.Application&quot;)
    .Visible = True
    .Navigate strUrl
    
    Do
        WScript.Sleep 100
    Loop Until Not .Busy And .ReadyState = READYSTATE_COMPLETE
    
    strContent = &quot;&quot;
    
    lngPrevLocale = SetLocale(&quot;en-us&quot;)
    
    With .Document.GetElementByID(&quot;settlementsOptionsProductTable&quot;)
        .deleteTHead
        .deleteTFoot
        
        For Each objHTMLTableRow In .rows
            If objHTMLTableRow.rowIndex &gt; 0 And objHTMLTableRow.rowIndex &lt; .rows.length - 1 Then
                For Each objHTMLTableCell In objHTMLTableRow.cells
                    SomeValue = objHTMLTableCell.innerText
                    
                    Select Case objHTMLTableCell.cellIndex
                        Case 0
                            If IsNumeric(SomeValue) Then
                                SomeValue = CSng(SomeValue) / 1000
                            End If
                        Case 1
                            Select Case SomeValue
                                Case &quot;Call&quot;
                                    SomeValue = 0
                                Case &quot;Put&quot;
                                    SomeValue = 1
                            End Select
                        Case 2, 3, 4, 5
                            If SomeValue = &quot;-&quot; Then
                                SomeValue = 0
                            ElseIf Right(SomeValue, 1) = &quot;A&quot; Or Right(SomeValue, 1) = &quot;B&quot; Then
                                SomeValue = Left(SomeValue, Len(SomeValue) - 1)
                                
                                If IsNumeric(SomeValue) Then
                                    SomeValue = CSng(SomeValue)
                                End If
                            End If
                        Case 6, 7
                            If IsNumeric(SomeValue) Then
                                SomeValue = CSng(SomeValue)
                            ElseIf SomeValue = &quot;UNCH&quot; Or SomeValue = &quot;CAB&quot; Then
                                SomeValue = -1
                            End If
                        Case 8, 9
                            If IsNumeric(SomeValue) Then
                                SomeValue = CLng(SomeValue)
                            End If
                    End Select
                    
                    strContent = strContent &amp; SomeValue
                    
                    If objHTMLTableCell.cellIndex &lt; objHTMLTableRow.cells.length - 1 Then
                        strContent = strContent &amp; &quot;;&quot;
                    End If
                Next
                
                strContent = strContent &amp; vbCrLf
            End If
        Next
    End With
    
    SetLocale lngPrevLocale
    
    .Quit
End With

With WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;)
    strPath = .BuildPath(WScript.CreateObject(&quot;WScript.Shell&quot;).SpecialFolders(&quot;Desktop&quot;), &quot;data.txt&quot;)
    
    With .CreateTextFile(strPath, True, True)
        .Write strContent
        .Close
    End With
End With

WScript.CreateObject(&quot;WScript.Shell&quot;).Run &quot;&quot;&quot;&quot; &amp; strPath &amp; &quot;&quot;&quot;&quot;, 1, False

WScript.Quit 0
</code></pre></div></div></div><p>Если нормально — закомментируйте видимость окна IE:<br /></p><div class="codebox"><pre><code>.Visible = True</code></pre></div><p>и уберите открытие результирующего файла в связанном приложении:<br /></p><div class="codebox"><pre><code>WScript.CreateObject(&quot;WScript.Shell&quot;).Run &quot;&quot;&quot;&quot; &amp; strPath &amp; &quot;&quot;&quot;&quot;, 1, False</code></pre></div><p>Кстати, обратите внимание — в Вашем коде данные <em>дописывались</em> в текстовый файл, я же его переписываю заново целиком. Смените вобрат, если Вам надо иначе.</p><div class="quotebox"><blockquote><p>и киньте РР адрес</p></blockquote></div><p>Вот сюда: <a href="http://forum.script-coding.com/viewtopic.php?id=7796">Поддержка данного ресурса</a>, если есть желание, можете попробовать перечислить на поддержку ресурса.</p>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Wed, 31 Dec 2014 12:51:36 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89900#p89900</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89898#p89898</link>
			<description><![CDATA[<p>первую строку не нужно , вот так должно быть как в файле</p><p>и если .12250В то 0.12250&nbsp; если .12030А то 0.1203 т.е без букв</p>]]></description>
			<author><![CDATA[null@example.com (charony)]]></author>
			<pubDate>Wed, 31 Dec 2014 12:17:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89898#p89898</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: Вытащить данные из динамичной таблицы]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89897#p89897</link>
			<description><![CDATA[<p>IE не закрывается процесс после работы скрипта</p>]]></description>
			<author><![CDATA[null@example.com (charony)]]></author>
			<pubDate>Wed, 31 Dec 2014 12:11:44 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89897#p89897</guid>
		</item>
	</channel>
</rss>
