<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=14416</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14416&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: chrome.ahk GetElementByClassName можно ли не в цикле?».]]></description>
		<lastBuildDate>Sat, 21 Jan 2023 21:49:57 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156482#p156482</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Спасибо за ответ <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Gh0sTG0)]]></author>
			<pubDate>Sat, 21 Jan 2023 21:49:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156482#p156482</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156481#p156481</link>
			<description><![CDATA[<p>Ну, используйте HTMLFILE, если вам так проще, не вижу проблемы.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 21 Jan 2023 21:48:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156481#p156481</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156480#p156480</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />То есть, через джаваскрипт можно одним запросом получить, допустим, результат 5 document.getElementsByClassName <em>быстрее</em>, чем если сделать 5 Page.Evaluate(&quot;document.getElementsByClassName...&quot;).Value?<br />Хотя, через ComObjCreate уже вроде как гораздо быстрее выходит, хотя я еще экспериментирую. Вероятно скорость еще идет потому, что работаю а) с гораздо меньшим куском страницы за раз, б) с еще меньшим куском, который заLOOPливается в&nbsp; работу.</p>]]></description>
			<author><![CDATA[null@example.com (Gh0sTG0)]]></author>
			<pubDate>Sat, 21 Jan 2023 21:45:53 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156480#p156480</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156479#p156479</link>
			<description><![CDATA[<p>Можно, получив html документа, создавать ComObjCreate(&quot;HTMLFile&quot;), а можно, если используете Chrome.ahk, выполнять всё то же самое через джаваскрипт прямо на странице, и получать результат.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 21 Jan 2023 21:41:19 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156479#p156479</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156478#p156478</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Да в принципе ничего особенного.<br />За пример сойдет хоть главная этого сайта. Задачи по типу получить наборами все href+innerText для class=&quot;hn&quot; (ссылка на раздел: AutoHotKey — Games, AutoHotKey и.т.д.), к ним получить соответствующие временя+ник последнего комментатора:<br /></p><div class="codebox"><pre><code>document.getElementsByClassName(&#039;info-lastpost&#039;)[1].children[2].innerText</code></pre></div><p>И все это упаковать в одну строку таблицы в правильном соотношении (только там не 13 пунктов, а много страниц по 50 пунктов).<br />Я уже типа представляю себе как это оформить достаточно прилично через ComObjCreate(&quot;HTMLFile&quot;), но если можно эту проблему решить как то еще... <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Gh0sTG0)]]></author>
			<pubDate>Sat, 21 Jan 2023 21:30:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156478#p156478</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156476#p156476</link>
			<description><![CDATA[<p>Парсить можно через создание объекта HTMLFILE, как в примере, или через регулярки. В зависимоcти от того, что именно нужно получить, я бы мог привести пример.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 21 Jan 2023 21:10:26 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156476#p156476</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156474#p156474</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Добавил Update.<br />Если вынимать только интересующий класс, то все становится на порядки быстрее (главная этого сайта спарсилась за ~50, почти мгновенно).<br />Но по прежнему немного не въезжаю как его дальше <em>правильно</em> парсить из состояния html текста в состояние &quot;мой набор ссылок и текста&quot;?</p><p><a href="http://forum.script-coding.com/viewtopic.php?pid=82783#p82783">http://forum.script-coding.com/viewtopi … 783#p82783</a> Вот это от тов. serzh82saratov еще актуально? Или уже придуманы более оптимальные способы?</p>]]></description>
			<author><![CDATA[null@example.com (Gh0sTG0)]]></author>
			<pubDate>Sat, 21 Jan 2023 20:30:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156474#p156474</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156472#p156472</link>
			<description><![CDATA[<p>Не знаю, не пробовал. В любом случае с моей версией класса это никак не связано.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 21 Jan 2023 20:23:16 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156472#p156472</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156470#p156470</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><div class="codebox"><pre><code>ChromeInst := new Chrome(A_Temp)
PageInst := ChromeInst.GetPage()
PageInst.Call(&quot;Page.navigate&quot;, {&quot;url&quot;: &quot;http://delfi.lv&quot;})
PageInst.WaitForLoad()

a := a_tickcount
res := PageInst.Evaluate(&quot;document.documentElement.outerHTML;&quot;)
msgbox % a_tickcount - a
MsgBox, % IsObject(res)

a := a_tickcount
str := JSON.Stringify(res)
msgbox % a_tickcount - a
MsgBox, % str

a := a_tickcount
obj := JSON.Parse(str)
msgbox % a_tickcount - a
MsgBox, % obj.value

class JSON
{
   static JS := JSON._GetJScripObject()
   
   Parse(JsonString)  {
      try oJSON := this.JS.(&quot;(&quot; JsonString &quot;)&quot;)
      catch  {
         MsgBox, Wrong JsonString!
         Return
      }
      Return this._CreateObject(oJSON)
   }
   
   Stringify(obj)  {
      if IsObject( obj )  {
         isArray := true
         for key in obj
            if !( key = A_Index || isArray := false )
               break
            
         for k, v in obj
            str .= ( A_Index = 1 ? &quot;&quot; : &quot;,&quot; ) . ( isArray ? &quot;&quot; : this.Stringify(k) . &quot;:&quot; ) . this.Stringify(v)

         return isArray ? &quot;[&quot; str &quot;]&quot; : &quot;{&quot; str &quot;}&quot;
      }
      else if !(obj*1 = &quot;&quot; || RegExMatch(obj, &quot;\s&quot;))
         return obj
      
      for k, v in [[&quot;\&quot;, &quot;\\&quot;], [A_Tab, &quot;\t&quot;], [&quot;&quot;&quot;&quot;, &quot;\&quot;&quot;&quot;], [&quot;/&quot;, &quot;\/&quot;], [&quot;`n&quot;, &quot;\n&quot;], [&quot;`r&quot;, &quot;\r&quot;], [Chr(12), &quot;\f&quot;], [Chr(08), &quot;\b&quot;]]
         obj := StrReplace( obj, v[1], v[2] )
      
      while RegexMatch( obj, &quot;[^\x20-\x7e]&quot;, key )  {
         str := Asc( key )
         val := &quot;\u&quot; . Chr( ( ( str &gt;&gt; 12 ) &amp; 15 ) + ( ( ( str &gt;&gt; 12 ) &amp; 15 ) &lt; 10 ? 48 : 55 ) )
               . Chr( ( ( str &gt;&gt; 8 ) &amp; 15 ) + ( ( ( str &gt;&gt; 8 ) &amp; 15 ) &lt; 10 ? 48 : 55 ) )
               . Chr( ( ( str &gt;&gt; 4 ) &amp; 15 ) + ( ( ( str &gt;&gt; 4 ) &amp; 15 ) &lt; 10 ? 48 : 55 ) )
               . Chr( ( str &amp; 15 ) + ( ( str &amp; 15 ) &lt; 10 ? 48 : 55 ) )
         obj := StrReplace(obj, key, val)
      }
      Return &quot;&quot;&quot;&quot; obj &quot;&quot;&quot;&quot;
   }
   
   GetFromUrl(url, body := &quot;&quot;, contentType := &quot;&quot;, userAgent := &quot;&quot;)  {
      ; в случае удачи будет возвращена строка, в случае ошибки — массив с одним элементом-строкой с описанием ошибки
      try  {
         XmlHttp := ComObjCreate(&quot;Microsoft.XmlHttp&quot;)
         XmlHttp.Open(&quot;GET&quot;, url, false)
         ( contentType &amp;&amp; XmlHttp.SetRequestHeader(&quot;Content-Type&quot;, contentType) )
         ( userAgent &amp;&amp; XmlHttp.SetRequestHeader(&quot;User-Agent&quot;, userAgent) )
         XmlHttp.Send(body)
      }
      catch e
         Return [&quot;Error!`n&quot; . e.Message]
      status := XmlHttp.Status
      Return status = 200 ? XmlHttp.ResponseText : [&quot;Error! Status: &quot; . status . &quot;, ResponseText: &quot; . XmlHttp.ResponseText]
   }

   _GetJScripObject()  {
      VarSetCapacity(tmpFile, ((MAX_PATH := 260) - 14) &lt;&lt; !!A_IsUnicode, 0)
      DllCall(&quot;GetTempFileName&quot;, Str, A_Temp, Str, &quot;AHK&quot;, UInt, 0, Str, tmpFile)
      
      FileAppend,
      (
      &lt;component&gt;
      &lt;public&gt;&lt;method name=&#039;eval&#039;/&gt;&lt;/public&gt;
      &lt;script language=&#039;JScript&#039;&gt;&lt;/script&gt;
      &lt;/component&gt;
      ), % tmpFile
      
      JS := ObjBindMethod( ComObjGet(&quot;script:&quot; . tmpFile), &quot;eval&quot; )
      FileDelete, % tmpFile
      JSON._AddMethods(JS)
      Return JS
   }

   _AddMethods(ByRef JS)  {
      JScript =
      (
         Object.prototype.GetKeys = function () {
            var keys = []
            for (var k in this)
               if (this.hasOwnProperty(k))
                  keys.push(k)
            return keys
         }
         Object.prototype.IsArray = function () {
            var toStandardString = {}.toString
            return toStandardString.call(this) == &#039;[object Array]&#039;
         }
      )
      JS.(&quot;delete ActiveXObject; delete GetObject;&quot;)
      JS.(JScript)
   }

   _CreateObject(ObjJS)  {
      res := ObjJS.IsArray()
      if (res = &quot;&quot;)
         Return ObjJS
      
      else if (res = -1)  {
         obj := []
         Loop % ObjJS.length
            obj[A_Index] := this._CreateObject(ObjJS[A_Index - 1])
      }
      else if (res = 0)  {
         obj := {}
         keys := ObjJS.GetKeys()
         Loop % keys.length
            k := keys[A_Index - 1], obj[k] := this._CreateObject(ObjJS[k])
      }
      Return obj
   }
}</code></pre></div></blockquote></div><p>Привет. решил попробовать еще разок во всем этом разобраться.<br />Возник вопрос по скорости:<br />document.documentElement.outerHTML и должно для google.com выполняться 12 секунд? (считал сам и в msgbox&#039;e цифра 12к+)</p><p>Update: Если поменять хтмл всего сайта на хтмл интересующего куска, то все становится гораздо быстрее.<br />Осталось только разобраться как его дальше парсить на ссылки, тексты и прочее.</p>]]></description>
			<author><![CDATA[null@example.com (Gh0sTG0)]]></author>
			<pubDate>Sat, 21 Jan 2023 20:05:45 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156470#p156470</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=130552#p130552</link>
			<description><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?id=14437">Создал</a> тему в Коллекции.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 24 Dec 2018 10:17:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=130552#p130552</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=130465#p130465</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>А, ну это же не позиционируется, как релиз, и ссылок на эти библиотеки нет. Кроме того, в Jxon.ahk нет методов Jxon_True() и Jxon_False().</p></blockquote></div><p>Прошу прощения за дезинформацию. В любом случае, мне было известно о встроенной поддержке JSON, но по душе Ваше творчество.</p>]]></description>
			<author><![CDATA[null@example.com (KusochekDobra)]]></author>
			<pubDate>Tue, 18 Dec 2018 22:10:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=130465#p130465</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=130459#p130459</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Точно не знаю, что там происходит,</p></blockquote></div><p>Автор библиотеки сказал, что<br /></p><div class="quotebox"><blockquote><p>The delay is caused by decoding chrome&#039;s response from a JSON message into an AHK object. Like with IE, the browser responds with the source immediately. However, IE responds with the text directly, and Chrome responds with a JSON blob that contains the text but must be decoded into a useful form. Because AutoHotkey does not support JSON encode/decode natively, this conversion must be done with a user-made script. That page&#039;s source is roughly 200kb, so the decoding process takes a while.</p></blockquote></div><p><a href="https://autohotkey.com/boards/viewtopic.php?p=218916#p218916">https://autohotkey.com/boards/viewtopic … 16#p218916</a><br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Там файл используется только один раз.</p></blockquote></div><p>Вот это я пропустил.<br />Тогда ничего криминального не случится, хотя я всё-равно не люблю лишние файлы.<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Ок, давай я один, ты — другой.</p></blockquote></div><p>Мне парсинг JSON пока не нужен.<br />Если будет нужен, то возьмусь, а так лень копаться. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 18 Dec 2018 12:20:41 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=130459#p130459</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=130457#p130457</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Сравни скорости</p></blockquote></div><p>Точно не знаю, что там происходит, но просто сравни дальше:<br /></p><div class="codebox"><pre><code>ChromeInst := new Chrome(A_Temp)
PageInst := ChromeInst.GetPage()
PageInst.Call(&quot;Page.navigate&quot;, {&quot;url&quot;: &quot;http://delfi.lv&quot;})
PageInst.WaitForLoad()

a := a_tickcount
res := PageInst.Evaluate(&quot;document.documentElement.outerHTML;&quot;)
msgbox % a_tickcount - a
MsgBox, % IsObject(res)

a := a_tickcount
str := JSON.Stringify(res)
msgbox % a_tickcount - a
MsgBox, % str

a := a_tickcount
obj := JSON.Parse(str)
msgbox % a_tickcount - a
MsgBox, % obj.value

class JSON
{
   static JS := JSON._GetJScripObject()
   
   Parse(JsonString)  {
      try oJSON := this.JS.(&quot;(&quot; JsonString &quot;)&quot;)
      catch  {
         MsgBox, Wrong JsonString!
         Return
      }
      Return this._CreateObject(oJSON)
   }
   
   Stringify(obj)  {
      if IsObject( obj )  {
         isArray := true
         for key in obj
            if !( key = A_Index || isArray := false )
               break
            
         for k, v in obj
            str .= ( A_Index = 1 ? &quot;&quot; : &quot;,&quot; ) . ( isArray ? &quot;&quot; : this.Stringify(k) . &quot;:&quot; ) . this.Stringify(v)

         return isArray ? &quot;[&quot; str &quot;]&quot; : &quot;{&quot; str &quot;}&quot;
      }
      else if !(obj*1 = &quot;&quot; || RegExMatch(obj, &quot;\s&quot;))
         return obj
      
      for k, v in [[&quot;\&quot;, &quot;\\&quot;], [A_Tab, &quot;\t&quot;], [&quot;&quot;&quot;&quot;, &quot;\&quot;&quot;&quot;], [&quot;/&quot;, &quot;\/&quot;], [&quot;`n&quot;, &quot;\n&quot;], [&quot;`r&quot;, &quot;\r&quot;], [Chr(12), &quot;\f&quot;], [Chr(08), &quot;\b&quot;]]
         obj := StrReplace( obj, v[1], v[2] )
      
      while RegexMatch( obj, &quot;[^\x20-\x7e]&quot;, key )  {
         str := Asc( key )
         val := &quot;\u&quot; . Chr( ( ( str &gt;&gt; 12 ) &amp; 15 ) + ( ( ( str &gt;&gt; 12 ) &amp; 15 ) &lt; 10 ? 48 : 55 ) )
               . Chr( ( ( str &gt;&gt; 8 ) &amp; 15 ) + ( ( ( str &gt;&gt; 8 ) &amp; 15 ) &lt; 10 ? 48 : 55 ) )
               . Chr( ( ( str &gt;&gt; 4 ) &amp; 15 ) + ( ( ( str &gt;&gt; 4 ) &amp; 15 ) &lt; 10 ? 48 : 55 ) )
               . Chr( ( str &amp; 15 ) + ( ( str &amp; 15 ) &lt; 10 ? 48 : 55 ) )
         obj := StrReplace(obj, key, val)
      }
      Return &quot;&quot;&quot;&quot; obj &quot;&quot;&quot;&quot;
   }
   
   GetFromUrl(url, body := &quot;&quot;, contentType := &quot;&quot;, userAgent := &quot;&quot;)  {
      ; в случае удачи будет возвращена строка, в случае ошибки — массив с одним элементом-строкой с описанием ошибки
      try  {
         XmlHttp := ComObjCreate(&quot;Microsoft.XmlHttp&quot;)
         XmlHttp.Open(&quot;GET&quot;, url, false)
         ( contentType &amp;&amp; XmlHttp.SetRequestHeader(&quot;Content-Type&quot;, contentType) )
         ( userAgent &amp;&amp; XmlHttp.SetRequestHeader(&quot;User-Agent&quot;, userAgent) )
         XmlHttp.Send(body)
      }
      catch e
         Return [&quot;Error!`n&quot; . e.Message]
      status := XmlHttp.Status
      Return status = 200 ? XmlHttp.ResponseText : [&quot;Error! Status: &quot; . status . &quot;, ResponseText: &quot; . XmlHttp.ResponseText]
   }

   _GetJScripObject()  {
      VarSetCapacity(tmpFile, ((MAX_PATH := 260) - 14) &lt;&lt; !!A_IsUnicode, 0)
      DllCall(&quot;GetTempFileName&quot;, Str, A_Temp, Str, &quot;AHK&quot;, UInt, 0, Str, tmpFile)
      
      FileAppend,
      (
      &lt;component&gt;
      &lt;public&gt;&lt;method name=&#039;eval&#039;/&gt;&lt;/public&gt;
      &lt;script language=&#039;JScript&#039;&gt;&lt;/script&gt;
      &lt;/component&gt;
      ), % tmpFile
      
      JS := ObjBindMethod( ComObjGet(&quot;script:&quot; . tmpFile), &quot;eval&quot; )
      FileDelete, % tmpFile
      JSON._AddMethods(JS)
      Return JS
   }

   _AddMethods(ByRef JS)  {
      JScript =
      (
         Object.prototype.GetKeys = function () {
            var keys = []
            for (var k in this)
               if (this.hasOwnProperty(k))
                  keys.push(k)
            return keys
         }
         Object.prototype.IsArray = function () {
            var toStandardString = {}.toString
            return toStandardString.call(this) == &#039;[object Array]&#039;
         }
      )
      JS.(&quot;delete ActiveXObject; delete GetObject;&quot;)
      JS.(JScript)
   }

   _CreateObject(ObjJS)  {
      res := ObjJS.IsArray()
      if (res = &quot;&quot;)
         Return ObjJS
      
      else if (res = -1)  {
         obj := []
         Loop % ObjJS.length
            obj[A_Index] := this._CreateObject(ObjJS[A_Index - 1])
      }
      else if (res = 0)  {
         obj := {}
         keys := ObjJS.GetKeys()
         Loop % keys.length
            k := keys[A_Index - 1], obj[k] := this._CreateObject(ObjJS[k])
      }
      Return obj
   }
}</code></pre></div><p>Кстати, обрати внимание:<br /></p><div class="codebox"><pre><code>static JS := JSON._GetJScripObject()</code></pre></div><p>Там файл используется только один раз.<br /></p><div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Поэтому я и предложил если публиковать, то публиковать 2 варианта</p></blockquote></div><p>Ок, давай я один, ты — другой. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 18 Dec 2018 11:21:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=130457#p130457</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=130456#p130456</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Там статья 2010 года, и, по-моему, речь идёт о браке.</p></blockquote></div><p>Моему ssd уже 7 лет, так что они почти ровесники.<br />JMicron или нет, не знаю, но по-любому стараюсь его зазря не дырявить.<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Для задач, где это применяется, скорость не критична, и время, которое тратится на парсинг, несравнимо меньше времени, потраченного на загрузку данных из сети.</p></blockquote></div><p>Не согласен. Например нам надо обнаружить изменение страницы и как только она изменится подать сигнал.<br />Сравни скорости:<br /></p><div class="codebox"><pre><code>oIE := ComObjCreate(&quot;InternetExplorer.Application&quot;)
oIE.visible := True
oIE.navigate(&quot;http://delfi.lv&quot;)
While oIE.readyState != 4 || oIE.document.readyState != &quot;complete&quot; || oIE.busy  
   sleep 10
a := a_tickcount
OuterHTML := oIE.Document.documentElement.OuterHtml
msgbox % a_tickcount - a</code></pre></div><p>и<br /></p><div class="codebox"><pre><code>ChromeInst := new Chrome()
PageInst := ChromeInst.GetPage()
PageInst.Call(&quot;Page.navigate&quot;, {&quot;url&quot;: &quot;http://delfi.lv&quot;})
PageInst.WaitForLoad()
a := a_tickcount
OuterHTML := PageInst.Evaluate(&quot;document.documentElement.outerHTML;&quot;).Value
msgbox % a_tickcount - a</code></pre></div><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Тут ответ очевиден — компактность кода</p></blockquote></div><p>Поэтому я и предложил если публиковать, то публиковать 2 варианта.<br />Так как для одних приоритет - компактность кода, для других - выполнение кода без создания лишних файлов.<br />Ну или если под Active script переделывать не хочется, то внести комментарии по поводу&nbsp; создания файла один раз и сохранения его на диске.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 18 Dec 2018 10:35:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=130456#p130456</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: chrome.ahk GetElementByClassName можно ли не в цикле?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=130455#p130455</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Для некоторых ssd хардов может быть неприятно</p></blockquote></div><p>Там статья 2010 года, и, по-моему, речь идёт о браке. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>это уже и так большой тормоз</p></blockquote></div><p>Для задач, где это применяется, скорость не критична, и время, которое тратится на парсинг, несравнимо меньше времени, потраченного на загрузку данных из сети.</p><div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Ну и зачем создавать файл, когда есть библиотека ActiveScript?</p></blockquote></div><p>Тут ответ очевиден — компактность кода. Ну и файл вовсе не обязательно создавать, можно просто один раз сохранить на диске.</p><p>А вообще если речь идёт о Хроме, JSON лучше парсить нативными методами js, да и вообще все ресурсоёмкие операции можно выполнять силами движка Хрома.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 18 Dec 2018 10:22:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=130455#p130455</guid>
		</item>
	</channel>
</rss>
