<?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="http://forum.script-coding.com/extern.php?action=feed&amp;tid=17765&amp;type=atom" />
	<updated>2023-05-10T00:14:34Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=17765</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158126#p158126" />
			<content type="html"><![CDATA[<p>То, что мы до этого делали, по сути и есть цикл с подстановкой значений. Хотите, платно возьмусь написать js, так лень возиться.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-10T00:14:34Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158126#p158126</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158125#p158125" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Напишите javascript, который будет получать все нужные тексты за раз.</p></blockquote></div><p>Был у ребят на форуме JS, сказали что в AutoHotKey можно создать цикл с подстановкой значений (по сути номер итерации) в скрипт.<br />И то, что лучше этот вопрос задать в форуме по AutoHotkey.<br />Помогите пожалуйста разобраться...</p>]]></content>
			<author>
				<name><![CDATA[Michael]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41356</uri>
			</author>
			<updated>2023-05-09T22:58:15Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158125#p158125</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158045#p158045" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Michael пишет:</cite><blockquote><p>И еще момент, время выполнения этого скрипта ~ 1 мин. 30 сек., можно как-то подускорить процесс?</p></blockquote></div><p>Напишите javascript, который будет получать все нужные тексты за раз.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-04T01:34:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158045#p158045</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158044#p158044" />
			<content type="html"><![CDATA[<p>Попробуйте догадаться.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-04T01:31:55Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158044#p158044</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158043#p158043" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><div class="codebox"><pre><code>js := &quot;(() =&gt; { let res = &#039;&#039;; try { res = document.getElementsByClassName(&#039;oc_1&#039;)[50].innerText; } catch(e) { res = &#039;текст, который будет выдаваться в случае ошибки&#039;; } return res; })()&quot;</code></pre></div></blockquote></div><p>Это вставлять вместо <em>js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[50].innerText&quot;</em> ?</p><p>И как отсюда убрать сообщение ошибки? Чтобы его просто не было вообще.</p><br /><p><strong>UPDATE:</strong><br /></p><div class="codebox"><pre><code>js := &quot;(() =&gt; { let res = &#039;&#039;; try { res = document.getElementsByClassName(&#039;oc_1&#039;)[50].innerText; } catch(e) { res = &#039;текст, который будет выдаваться в случае ошибки&#039;; } return res; })()&quot;</code></pre></div><p>Это работает, но только если такая строка одна, а у меня: <br /></p><div class="codebox"><pre><code>js1 := &quot;(() =&gt; { let res = &#039;&#039;; try { res = document.getElementsByClassName(&#039;oc_1&#039;)[50].innerText; } catch(e) { res = &#039;Пусто&#039;; } return res; })()&quot;
js2 := &quot;(() =&gt; { let res = &#039;&#039;; try { res = document.getElementsByClassName(&#039;oc_2&#039;)[50].innerText; } catch(e) { res = &#039;Пусто&#039;; } return res; })()&quot;
js3 := &quot;(() =&gt; { let res = &#039;&#039;; try { res = document.getElementsByClassName(&#039;oc_3&#039;)[50].innerText; } catch(e) { res = &#039;Пусто&#039;; } return res; })()&quot;</code></pre></div><p>Подскажите, где тут ошибка?</p>]]></content>
			<author>
				<name><![CDATA[Michael]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41356</uri>
			</author>
			<updated>2023-05-04T01:18:04Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158043#p158043</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158042#p158042" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Не очень понял, какие существующие.</p></blockquote></div><p>Смотрите, возьмем конкретный пример, я как раз разобрался еще как заполнять другие столбцы и дополнил скрипт, вот его полный вариант:<br /></p><div class="codebox"><pre><code>if IsAdmin = 0
{

		CommandLine := DllCall(&quot;GetCommandLine&quot;, &quot;Str&quot;)
		If !(A_IsAdmin || RegExMatch(CommandLine, &quot; /restart(?!\S)&quot;)) 
		{
   				Try 
   				{
        				If (A_IsCompiled) 
        				{
           						Run *RunAs &quot;%A_ScriptFullPath%&quot; /restart
        				} 
				        Else 
				        {
				            	Run *RunAs &quot;%A_AhkPath%&quot; /restart &quot;%A_ScriptFullPath%&quot;
				        }
    			}
   				ExitApp
		}

}

SetBatchLines, 1ms

Gui, Add, ListView, r50 w700 gMyListView, Ник|Очки|Дата приема|Должно быть очков|Недобор очков

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[0].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[0].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[0].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[1].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[1].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[1].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[2].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[2].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[2].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[3].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[3].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[3].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[4].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[4].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[4].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[5].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[5].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[5].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[6].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[6].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[6].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[7].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[7].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[7].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[8].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[8].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[8].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[9].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[9].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[9].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[10].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[10].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[10].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[11].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[11].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[11].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[12].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[12].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[12].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[12].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[12].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[12].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[12].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[12].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[12].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[13].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[13].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[13].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[14].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[14].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[14].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[15].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[15].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[15].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[16].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[16].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[16].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[17].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[17].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[17].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[18].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[18].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[18].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[19].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[19].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[19].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[20].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[20].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[20].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[21].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[21].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[21].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[22].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[22].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[22].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[23].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[23].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[23].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[24].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[24].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[24].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[25].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[25].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[25].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[26].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[26].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[26].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[27].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[27].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[27].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[28].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[28].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[28].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[29].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[29].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[29].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[30].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[30].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[30].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[31].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[31].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[31].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[32].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[32].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[32].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[33].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[33].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[33].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[34].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[34].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[34].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[35].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[35].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[35].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[36].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[36].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[36].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[37].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[37].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[37].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[38].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[38].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[38].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[39].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[39].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[39].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[40].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[40].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[40].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[41].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[41].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[41].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[42].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[42].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[42].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[43].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[43].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[43].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[44].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[44].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[44].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[45].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[45].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[45].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[46].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[46].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[46].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[47].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[47].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[47].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[48].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[48].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[48].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

js1 := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[49].innerText&quot;
js2 := &quot;document.getElementsByClassName(&#039;oc_3&#039;)[49].innerText&quot;
js3 := &quot;document.getElementsByClassName(&#039;oc_5&#039;)[49].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)
LV_Add(&quot;&quot;, GetInfoFromWebPage(js1, hWnd), GetInfoFromWebPage(js2, hWnd), GetInfoFromWebPage(js3, hWnd))

GetInfoFromWebPage(jsToGetInfo, hwnd) {
   tempClip := ClipboardAll
   Clipboard := &quot;&quot;
   js := JsCopyTextFromWebPage(jsToGetInfo)
   RunJsFromChromeAddressBar(js, hwnd)
   ClipWait, 1
   err := ErrorLevel
   text := Clipboard
   Clipboard := tempClip
   if err
      throw
   Return text
}

JsCopyTextFromWebPage(jsToGetInfo) {
   js =
   (
      ((textToCopy) =&gt; {
         if (window.location.protocol === &#039;https:&#039;) {
            document.documentElement.focus();
            const timer = setInterval(() =&gt; {
               if (document.hasFocus()) {
                  clearInterval(timer);
                  navigator.clipboard.writeText(textToCopy);
               }
            }, 10);
         } else {
            const textArea = document.createElement(&#039;textarea&#039;);
            textArea.value = textToCopy;
            textArea.wrap = &#039;off&#039;;
            textArea.rows = 100000;
            textArea.style.position = &#039;fixed&#039;;
            document.documentElement.appendChild(textArea);
            textArea.focus();
            textArea.select();
            document.execCommand(&#039;copy&#039;);
            textArea.remove();
         }
      })(%jsToGetInfo%);
   )
   Return js
}

RunJsFromChromeAddressBar(js, hwnd) {
   static WM_GETOBJECT := 0x3D
        , ROLE_SYSTEM_TEXT := 0x2A
        , STATE_SYSTEM_FOCUSABLE := 0x100000
        , SELFLAG_TAKEFOCUS := 0x1
        , AccAddrBars := []
   if !AccAddrBars.HasKey(hwnd) {
      SendMessage, WM_GETOBJECT, 0, 1, Chrome_RenderWidgetHostHWND1, ahk_id %hwnd%
      AccChrome := AccObjectFromWindow(hwnd)
      AccAddrBars[hwnd] := SearchElement(AccChrome, {Role: ROLE_SYSTEM_TEXT, State: STATE_SYSTEM_FOCUSABLE})
   }
   AccAddrBar := AccAddrBars[hwnd]
   AccAddrBar.accValue(0) := &quot;javascript:&quot; . js
   Sleep, 100
   WinActivate, ahk_id %hwnd%
   AccAddrBar.accSelect(SELFLAG_TAKEFOCUS, 0)
   Sleep, 100
   Loop {
      ControlSend,, {Enter}, ahk_id %hwnd%, Chrome Legacy Window
      Sleep, 200
   } until AccAddrBar.accValue(0) != &quot;javascript:&quot; . js
}

SearchElement(parentElement, params)
{ ; params — object like {Role: ROLE_SYSTEM_PUSHBUTTON := 0x2B, Name: &quot;5&quot;}
   found := true
   for k, v in params {
      try {
         if (k = &quot;State&quot;)
            (!(parentElement.accState(0)    &amp; v) &amp;&amp; found := false)
         else if (k ~= &quot;^(Name|Value)$&quot;)
            (!(parentElement[&quot;acc&quot; . k](0) ~= v) &amp;&amp; found := false)
         else if (k = &quot;ChildCount&quot;)
            (parentElement[&quot;acc&quot; . k]      != v  &amp;&amp; found := false)
         else
            (parentElement[&quot;acc&quot; . k](0)   != v  &amp;&amp; found := false)
      }
      catch 
         found := false
   } until !found
   if found
      Return parentElement
   
   for k, v in AccChildren(parentElement)
      if obj := SearchElement(v, params)
         Return obj
}

AccObjectFromWindow(hWnd, idObject = 0) {
   static IID_IDispatch   := &quot;{00020400-0000-0000-C000-000000000046}&quot;
        , IID_IAccessible := &quot;{618736E0-3C3D-11CF-810C-00AA00389B71}&quot;
        , OBJID_NATIVEOM  := 0xFFFFFFF0, VT_DISPATCH := 9, F_OWNVALUE := 1
        , h := DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;oleacc&quot;, &quot;Ptr&quot;)
        
   VarSetCapacity(IID, 16), idObject &amp;= 0xFFFFFFFF
   DllCall(&quot;ole32\CLSIDFromString&quot;, &quot;Str&quot;, idObject = OBJID_NATIVEOM ? IID_IDispatch : IID_IAccessible, &quot;Ptr&quot;, &amp;IID)
   if DllCall(&quot;oleacc\AccessibleObjectFromWindow&quot;, &quot;Ptr&quot;, hWnd, &quot;UInt&quot;, idObject, &quot;Ptr&quot;, &amp;IID, &quot;PtrP&quot;, pAcc) = 0
      Return ComObject(VT_DISPATCH, pAcc, F_OWNVALUE)
}

AccChildren(Acc) {
   static VT_DISPATCH := 9
   Loop 1  {
      if ComObjType(Acc, &quot;Name&quot;) != &quot;IAccessible&quot;  {
         error := &quot;Invalid IAccessible Object&quot;
         break
      }
      try cChildren := Acc.accChildCount
      catch
         Return &quot;&quot;
      if !cChildren
         Return
      Children := []
      VarSetCapacity(varChildren, cChildren*(8 + A_PtrSize*2), 0)
      res := DllCall(&quot;oleacc\AccessibleChildren&quot;, &quot;Ptr&quot;, ComObjValue(Acc), &quot;Int&quot;, 0
                                                , &quot;Int&quot;, cChildren, &quot;Ptr&quot;, &amp;varChildren, &quot;IntP&quot;, cChildren)
      if (res != 0) {
         error := &quot;AccessibleChildren DllCall Failed&quot;
         break
      }
      Loop % cChildren  {
         i := (A_Index - 1)*(A_PtrSize*2 + 8)
         child := NumGet(varChildren, i + 8)
         Children.Push( (b := NumGet(varChildren, i) = VT_DISPATCH) ? AccQuery(child) : child )
         ( b &amp;&amp; ObjRelease(child) )
      }
   }
   if error
      ErrorLevel := error
   else
      Return Children.MaxIndex() ? Children : &quot;&quot;
}

AccQuery(Acc) {
   static IAccessible := &quot;{618736e0-3c3d-11cf-810c-00aa00389b71}&quot;, VT_DISPATCH := 9, F_OWNVALUE := 1
   try Return ComObject(VT_DISPATCH, ComObjQuery(Acc, IAccessible), F_OWNVALUE)
}

Gui, Show
return

MyListView:</code></pre></div><p>Получается, скрипт на 50 (максимальное колличетсво) имен (опустим нюансы) в таблице.</p><p>В данный момент в клане 48 человек, соотвественно, таблица идет на 48 человек.</p><p>Мне нужно, чтобы скрипт, в случае, если таблица &lt;50 строк, без всяких ошибок и уведомлений просто создавал таблицу на то колличество строк, которое сейчас есть на сайте.</p><p>И еще момент, время выполнения этого скрипта ~ 1 мин. 30 сек., можно как-то подускорить процесс? <span class="bbu">SetBatchLines</span> - не помогает.</p>]]></content>
			<author>
				<name><![CDATA[Michael]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41356</uri>
			</author>
			<updated>2023-05-04T01:14:22Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158042#p158042</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158040#p158040" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Michael пишет:</cite><blockquote><p>выдавало существующие?</p></blockquote></div><p>Не очень понял, какие существующие. Можно так попробовать:<br /></p><div class="codebox"><pre><code>js := &quot;(() =&gt; { let res = &#039;&#039;; try { res = document.getElementsByClassName(&#039;oc_1&#039;)[50].innerText; } catch(e) { res = &#039;текст, который будет выдаваться в случае ошибки&#039;; } return res; })()&quot;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-04T00:48:12Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158040#p158040</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158039#p158039" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><div class="quotebox"><cite>Michael пишет:</cite><blockquote><p>Duplicate function definition</p></blockquote></div><p>Читайте про функции, что это такое, зачем они нужны, позапускайте примеры из документации. Вы пытаетесь применить сложные конструкции, не разобравшись в элементарных.</p></blockquote></div><p>Почитал, понял что функции достаточно одной на весь скрипт, добавлял только:</p><div class="codebox"><pre><code>js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[4].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))</code></pre></div><p>Если добавлять 3-4 JS скрипта - работает адекватно, как должно, все выводится в ListView.</p><p>Если добавить все 50 сразу - после минуты выходит ошибка &quot;<strong>An exception was thrown</strong>&quot; и не добавляет ничего.<br /><span class="bbu"><br />Я поставил задержку в 100мс между JS, но это не помогает. Может быть какой-то лимит?</span></p><p>Вот полный скрипт:</p><div class="codebox"><pre><code>if IsAdmin = 0
{

		CommandLine := DllCall(&quot;GetCommandLine&quot;, &quot;Str&quot;)
		If !(A_IsAdmin || RegExMatch(CommandLine, &quot; /restart(?!\S)&quot;)) 
		{
   				Try 
   				{
        				If (A_IsCompiled) 
        				{
           						Run *RunAs &quot;%A_ScriptFullPath%&quot; /restart
        				} 
				        Else 
				        {
				            	Run *RunAs &quot;%A_AhkPath%&quot; /restart &quot;%A_ScriptFullPath%&quot;
				        }
    			}
   				ExitApp
		}

}

Gui, Add, ListView, r50 w700 gMyListView, Имя|Очки|Дата приема|Норма|Недобор

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[0].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))

GetInfoFromWebPage(jsToGetInfo, hwnd) {
   tempClip := ClipboardAll
   Clipboard := &quot;&quot;
   js := JsCopyTextFromWebPage(jsToGetInfo)
   RunJsFromChromeAddressBar(js, hwnd)
   ClipWait, 2
   err := ErrorLevel
   text := Clipboard
   Clipboard := tempClip
   if err
      throw
   Return text
}

JsCopyTextFromWebPage(jsToGetInfo) {
   js =
   (
      ((textToCopy) =&gt; {
         if (window.location.protocol === &#039;https:&#039;) {
            document.documentElement.focus();
            const timer = setInterval(() =&gt; {
               if (document.hasFocus()) {
                  clearInterval(timer);
                  navigator.clipboard.writeText(textToCopy);
               }
            }, 10);
         } else {
            const textArea = document.createElement(&#039;textarea&#039;);
            textArea.value = textToCopy;
            textArea.wrap = &#039;off&#039;;
            textArea.rows = 100000;
            textArea.style.position = &#039;fixed&#039;;
            document.documentElement.appendChild(textArea);
            textArea.focus();
            textArea.select();
            document.execCommand(&#039;copy&#039;);
            textArea.remove();
         }
      })(%jsToGetInfo%);
   )
   Return js
}

RunJsFromChromeAddressBar(js, hwnd) {
   static WM_GETOBJECT := 0x3D
        , ROLE_SYSTEM_TEXT := 0x2A
        , STATE_SYSTEM_FOCUSABLE := 0x100000
        , SELFLAG_TAKEFOCUS := 0x1
        , AccAddrBars := []
   if !AccAddrBars.HasKey(hwnd) {
      SendMessage, WM_GETOBJECT, 0, 1, Chrome_RenderWidgetHostHWND1, ahk_id %hwnd%
      AccChrome := AccObjectFromWindow(hwnd)
      AccAddrBars[hwnd] := SearchElement(AccChrome, {Role: ROLE_SYSTEM_TEXT, State: STATE_SYSTEM_FOCUSABLE})
   }
   AccAddrBar := AccAddrBars[hwnd]
   AccAddrBar.accValue(0) := &quot;javascript:&quot; . js
   Sleep, 100
   WinActivate, ahk_id %hwnd%
   AccAddrBar.accSelect(SELFLAG_TAKEFOCUS, 0)
   Sleep, 100
   Loop {
      ControlSend,, {Enter}, ahk_id %hwnd%, Chrome Legacy Window
      Sleep, 200
   } until AccAddrBar.accValue(0) != &quot;javascript:&quot; . js
}

SearchElement(parentElement, params)
{ ; params — object like {Role: ROLE_SYSTEM_PUSHBUTTON := 0x2B, Name: &quot;5&quot;}
   found := true
   for k, v in params {
      try {
         if (k = &quot;State&quot;)
            (!(parentElement.accState(0)    &amp; v) &amp;&amp; found := false)
         else if (k ~= &quot;^(Name|Value)$&quot;)
            (!(parentElement[&quot;acc&quot; . k](0) ~= v) &amp;&amp; found := false)
         else if (k = &quot;ChildCount&quot;)
            (parentElement[&quot;acc&quot; . k]      != v  &amp;&amp; found := false)
         else
            (parentElement[&quot;acc&quot; . k](0)   != v  &amp;&amp; found := false)
      }
      catch 
         found := false
   } until !found
   if found
      Return parentElement
   
   for k, v in AccChildren(parentElement)
      if obj := SearchElement(v, params)
         Return obj
}

AccObjectFromWindow(hWnd, idObject = 0) {
   static IID_IDispatch   := &quot;{00020400-0000-0000-C000-000000000046}&quot;
        , IID_IAccessible := &quot;{618736E0-3C3D-11CF-810C-00AA00389B71}&quot;
        , OBJID_NATIVEOM  := 0xFFFFFFF0, VT_DISPATCH := 9, F_OWNVALUE := 1
        , h := DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;oleacc&quot;, &quot;Ptr&quot;)
        
   VarSetCapacity(IID, 16), idObject &amp;= 0xFFFFFFFF
   DllCall(&quot;ole32\CLSIDFromString&quot;, &quot;Str&quot;, idObject = OBJID_NATIVEOM ? IID_IDispatch : IID_IAccessible, &quot;Ptr&quot;, &amp;IID)
   if DllCall(&quot;oleacc\AccessibleObjectFromWindow&quot;, &quot;Ptr&quot;, hWnd, &quot;UInt&quot;, idObject, &quot;Ptr&quot;, &amp;IID, &quot;PtrP&quot;, pAcc) = 0
      Return ComObject(VT_DISPATCH, pAcc, F_OWNVALUE)
}

AccChildren(Acc) {
   static VT_DISPATCH := 9
   Loop 1  {
      if ComObjType(Acc, &quot;Name&quot;) != &quot;IAccessible&quot;  {
         error := &quot;Invalid IAccessible Object&quot;
         break
      }
      try cChildren := Acc.accChildCount
      catch
         Return &quot;&quot;
      if !cChildren
         Return
      Children := []
      VarSetCapacity(varChildren, cChildren*(8 + A_PtrSize*2), 0)
      res := DllCall(&quot;oleacc\AccessibleChildren&quot;, &quot;Ptr&quot;, ComObjValue(Acc), &quot;Int&quot;, 0
                                                , &quot;Int&quot;, cChildren, &quot;Ptr&quot;, &amp;varChildren, &quot;IntP&quot;, cChildren)
      if (res != 0) {
         error := &quot;AccessibleChildren DllCall Failed&quot;
         break
      }
      Loop % cChildren  {
         i := (A_Index - 1)*(A_PtrSize*2 + 8)
         child := NumGet(varChildren, i + 8)
         Children.Push( (b := NumGet(varChildren, i) = VT_DISPATCH) ? AccQuery(child) : child )
         ( b &amp;&amp; ObjRelease(child) )
      }
   }
   if error
      ErrorLevel := error
   else
      Return Children.MaxIndex() ? Children : &quot;&quot;
}

AccQuery(Acc) {
   static IAccessible := &quot;{618736e0-3c3d-11cf-810c-00aa00389b71}&quot;, VT_DISPATCH := 9, F_OWNVALUE := 1
   try Return ComObject(VT_DISPATCH, ComObjQuery(Acc, IAccessible), F_OWNVALUE)
}

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[1].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[2].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[3].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[4].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[5].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[6].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[7].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[8].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[9].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[10].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[11].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[12].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[13].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[14].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[15].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[16].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[17].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[18].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[19].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[20].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[21].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[22].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[23].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[24].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[25].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[26].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[27].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[28].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[29].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[30].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[31].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[32].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[33].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[34].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[35].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[36].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[37].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[38].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[39].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[40].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[41].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[42].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[43].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[44].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[45].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[46].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[47].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[48].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))
Sleep, 100

js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[49].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))

Gui, Show
return

MyListView:</code></pre></div><p><strong>UPDATE! </strong></p><p>Понял почему ошибка, колличество игроков в клане меняется (максимум 50).</p><p>И если игроков допустим 45, а JS&nbsp; у меня на 50, то вылезает эта ошибка &quot;<strong>An exception was thrown</strong>&quot; и не добавляет ничего.</p><p>Можно как то обозначить, что в случае если JS ведут на пустые поля, чтобы не выдавало ошибку, и выдавало существующие?</p>]]></content>
			<author>
				<name><![CDATA[Michael]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41356</uri>
			</author>
			<updated>2023-05-03T22:03:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158039#p158039</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158038#p158038" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Michael пишет:</cite><blockquote><p>Duplicate function definition</p></blockquote></div><p>Читайте про функции, что это такое, зачем они нужны, позапускайте примеры из документации. Вы пытаетесь применить сложные конструкции, не разобравшись в элементарных.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-03T21:30:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158038#p158038</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158037#p158037" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>От администратора не выходит?</p></blockquote></div><p>Выше отписал, с администратором разобрался и с той ошибкой тоже, появился новый вопрос, он тоже в сообщении выше <img src="//forum.script-coding.com/img/smilies/roll.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Michael]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41356</uri>
			</author>
			<updated>2023-05-03T21:24:19Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158037#p158037</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158036#p158036" />
			<content type="html"><![CDATA[<p>От администратора не выходит?<br /></p><div class="quotebox"><cite>Michael пишет:</cite><blockquote><p>пишет ошибку &quot;Failed to get text&quot; и не запускается вообще</p></blockquote></div><p>Если что-то пишет, значит запускается.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-03T21:20:32Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158036#p158036</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158033#p158033" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Может не так выразился, но не выходит, пишет ошибку &quot;Failed to get text&quot; и не запускается вообще, или я что-то не так сделал?</p><div class="codebox"><pre><code>if IsAdmin = 0
{

		CommandLine := DllCall(&quot;GetCommandLine&quot;, &quot;Str&quot;)
		If !(A_IsAdmin || RegExMatch(CommandLine, &quot; /restart(?!\S)&quot;)) 
		{
   				Try 
   				{
        				If (A_IsCompiled) 
        				{
           						Run *RunAs &quot;%A_ScriptFullPath%&quot; /restart
        				} 
				        Else 
				        {
				            	Run *RunAs &quot;%A_AhkPath%&quot; /restart &quot;%A_ScriptFullPath%&quot;
				        }
    			}
   				ExitApp
		}

}


Gui, Add, ListView, r50 w700 gMyListView, Имя|Очки|Дата приема|Норма|Недобор

LV_Add(GetInfoFromWebPage(js, hWnd))


js := &quot;document.getElementsByClassName(&#039;oc_1&#039;)[0].innerText&quot;
hWnd := WinExist(&quot;ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe&quot;)

GetInfoFromWebPage(jsToGetInfo, hwnd) {
   tempClip := ClipboardAll
   Clipboard := &quot;&quot;
   js := JsCopyTextFromWebPage(jsToGetInfo)
   RunJsFromChromeAddressBar(js, hwnd)
   ClipWait, 2
   err := ErrorLevel
   text := Clipboard
   Clipboard := tempClip
   if err
      throw &quot;Failed to get text&quot;
   Return text
}

JsCopyTextFromWebPage(jsToGetInfo) {
   js =
   (
      ((textToCopy) =&gt; {
         if (window.location.protocol === &#039;https:&#039;) {
            document.documentElement.focus();
            const timer = setInterval(() =&gt; {
               if (document.hasFocus()) {
                  clearInterval(timer);
                  navigator.clipboard.writeText(textToCopy);
               }
            }, 10);
         } else {
            const textArea = document.createElement(&#039;textarea&#039;);
            textArea.value = textToCopy;
            textArea.wrap = &#039;off&#039;;
            textArea.rows = 100000;
            textArea.style.position = &#039;fixed&#039;;
            document.documentElement.appendChild(textArea);
            textArea.focus();
            textArea.select();
            document.execCommand(&#039;copy&#039;);
            textArea.remove();
         }
      })(%jsToGetInfo%);
   )
   Return js
}

RunJsFromChromeAddressBar(js, hwnd) {
   static WM_GETOBJECT := 0x3D
        , ROLE_SYSTEM_TEXT := 0x2A
        , STATE_SYSTEM_FOCUSABLE := 0x100000
        , SELFLAG_TAKEFOCUS := 0x1
        , AccAddrBars := []
   if !AccAddrBars.HasKey(hwnd) {
      SendMessage, WM_GETOBJECT, 0, 1, Chrome_RenderWidgetHostHWND1, ahk_id %hwnd%
      AccChrome := AccObjectFromWindow(hwnd)
      AccAddrBars[hwnd] := SearchElement(AccChrome, {Role: ROLE_SYSTEM_TEXT, State: STATE_SYSTEM_FOCUSABLE})
   }
   AccAddrBar := AccAddrBars[hwnd]
   AccAddrBar.accValue(0) := &quot;javascript:&quot; . js
   Sleep, 100
   WinActivate, ahk_id %hwnd%
   AccAddrBar.accSelect(SELFLAG_TAKEFOCUS, 0)
   Sleep, 100
   Loop {
      ControlSend,, {Enter}, ahk_id %hwnd%, Chrome Legacy Window
      Sleep, 200
   } until AccAddrBar.accValue(0) != &quot;javascript:&quot; . js
}

SearchElement(parentElement, params)
{ ; params — object like {Role: ROLE_SYSTEM_PUSHBUTTON := 0x2B, Name: &quot;5&quot;}
   found := true
   for k, v in params {
      try {
         if (k = &quot;State&quot;)
            (!(parentElement.accState(0)    &amp; v) &amp;&amp; found := false)
         else if (k ~= &quot;^(Name|Value)$&quot;)
            (!(parentElement[&quot;acc&quot; . k](0) ~= v) &amp;&amp; found := false)
         else if (k = &quot;ChildCount&quot;)
            (parentElement[&quot;acc&quot; . k]      != v  &amp;&amp; found := false)
         else
            (parentElement[&quot;acc&quot; . k](0)   != v  &amp;&amp; found := false)
      }
      catch 
         found := false
   } until !found
   if found
      Return parentElement
   
   for k, v in AccChildren(parentElement)
      if obj := SearchElement(v, params)
         Return obj
}

AccObjectFromWindow(hWnd, idObject = 0) {
   static IID_IDispatch   := &quot;{00020400-0000-0000-C000-000000000046}&quot;
        , IID_IAccessible := &quot;{618736E0-3C3D-11CF-810C-00AA00389B71}&quot;
        , OBJID_NATIVEOM  := 0xFFFFFFF0, VT_DISPATCH := 9, F_OWNVALUE := 1
        , h := DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;oleacc&quot;, &quot;Ptr&quot;)
        
   VarSetCapacity(IID, 16), idObject &amp;= 0xFFFFFFFF
   DllCall(&quot;ole32\CLSIDFromString&quot;, &quot;Str&quot;, idObject = OBJID_NATIVEOM ? IID_IDispatch : IID_IAccessible, &quot;Ptr&quot;, &amp;IID)
   if DllCall(&quot;oleacc\AccessibleObjectFromWindow&quot;, &quot;Ptr&quot;, hWnd, &quot;UInt&quot;, idObject, &quot;Ptr&quot;, &amp;IID, &quot;PtrP&quot;, pAcc) = 0
      Return ComObject(VT_DISPATCH, pAcc, F_OWNVALUE)
}

AccChildren(Acc) {
   static VT_DISPATCH := 9
   Loop 1  {
      if ComObjType(Acc, &quot;Name&quot;) != &quot;IAccessible&quot;  {
         error := &quot;Invalid IAccessible Object&quot;
         break
      }
      try cChildren := Acc.accChildCount
      catch
         Return &quot;&quot;
      if !cChildren
         Return
      Children := []
      VarSetCapacity(varChildren, cChildren*(8 + A_PtrSize*2), 0)
      res := DllCall(&quot;oleacc\AccessibleChildren&quot;, &quot;Ptr&quot;, ComObjValue(Acc), &quot;Int&quot;, 0
                                                , &quot;Int&quot;, cChildren, &quot;Ptr&quot;, &amp;varChildren, &quot;IntP&quot;, cChildren)
      if (res != 0) {
         error := &quot;AccessibleChildren DllCall Failed&quot;
         break
      }
      Loop % cChildren  {
         i := (A_Index - 1)*(A_PtrSize*2 + 8)
         child := NumGet(varChildren, i + 8)
         Children.Push( (b := NumGet(varChildren, i) = VT_DISPATCH) ? AccQuery(child) : child )
         ( b &amp;&amp; ObjRelease(child) )
      }
   }
   if error
      ErrorLevel := error
   else
      Return Children.MaxIndex() ? Children : &quot;&quot;
}

AccQuery(Acc) {
   static IAccessible := &quot;{618736e0-3c3d-11cf-810c-00aa00389b71}&quot;, VT_DISPATCH := 9, F_OWNVALUE := 1
   try Return ComObject(VT_DISPATCH, ComObjQuery(Acc, IAccessible), F_OWNVALUE)
}


Gui, Show
return

MyListView:
</code></pre></div><p><strong>UPDATE!</strong></p><p>Нашел ошибку, в строке:<br /></p><div class="codebox"><pre><code>LV_Add(GetInfoFromWebPage(js, hWnd))</code></pre></div><p>Поменял на:<br /></p><div class="codebox"><pre><code>LV_Add(&quot;&quot;, GetInfoFromWebPage(js, hWnd))</code></pre></div><p>По итогу записалось нужное значение в таблицу, прогресс.</p><p>Пытаюсь вставить вторую строку в ListView, скопировал всё, и продублировал ниже, заменив только JS, на что получил ошибку:<br /></p><div class="codebox"><pre><code>Duplicate function definition.
Specifically: GetInfoFromWebPage(jsToGetInfo, hwnd)</code></pre></div><p>Как мне остальные значения добавить в ListView?<br />Понимаю что тут должно быть что-то очень простое, но пока сижу туплю... Прошу помощи <img src="//forum.script-coding.com/img/smilies/roll.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Michael]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41356</uri>
			</author>
			<updated>2023-05-03T20:51:42Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158033#p158033</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158026#p158026" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Michael пишет:</cite><blockquote><p>Подскажите, пожалуйста, как привязать JS скрипты к ListView</p></blockquote></div><p>Ничего привязывать не нужно, просто записывайте заранее полученные значения через LV_Add(), либо меняйте существующие через LV_Modify(), читайте справку по ним.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-03T18:16:32Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158026#p158026</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158023#p158023" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Я бы использовал ListView.</p></blockquote></div><p>Набросал вот так с ListView:<br /></p><div class="codebox"><pre><code>#SingleInstance Force
#NoEnv
SetBatchLines -1

Gui, Add, ListView, r50 w700 gMyListView, Имя|Очки|Дата приема|Норма|Недобор

;Loop,
;    LV_Add()


Gui, Show
return

MyListView:</code></pre></div><p>_________________________________________________________</p><p>Подскажите, пожалуйста, как привязать JS скрипты к ListView (первая строка):</p><p>Первая колонка:<br /></p><div class="codebox"><pre><code>document.getElementsByClassName(&quot;oc_1&quot;)[0].innerText</code></pre></div><p>Вторая колонка:<br /></p><div class="codebox"><pre><code>document.getElementsByClassName(&quot;oc_3&quot;)[0].innerText </code></pre></div><p>Третья колонка<br /></p><div class="codebox"><pre><code>document.getElementsByClassName(&quot;oc_5&quot;)[0].innerText 
</code></pre></div><p>А по строкам нужно чтобы менялось значение [0], от 0 до 49</p><p>___________________________________________________________</p><p>То есть, вторая строка в ListView должна выводиться по таким скриптам: </p><p>Первая колонка:<br /></p><div class="codebox"><pre><code>document.getElementsByClassName(&quot;oc_1&quot;)[1].innerText</code></pre></div><p>Вторая колонка:<br /></p><div class="codebox"><pre><code>document.getElementsByClassName(&quot;oc_3&quot;)[1].innerText</code></pre></div><p> <br />Третья колонка<br /></p><div class="codebox"><pre><code>document.getElementsByClassName(&quot;oc_5&quot;)[1].innerText </code></pre></div><p>Ну и так далее, до [49].</p>]]></content>
			<author>
				<name><![CDATA[Michael]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41356</uri>
			</author>
			<updated>2023-05-03T16:27:28Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158023#p158023</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить список с сайта в таблице, с авторизацией]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158015#p158015" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Michael пишет:</cite><blockquote><p>Работает только от имени администратора</p></blockquote></div><p>Так не должно быть, у меня работает от обычного пользователя. Возможно, Хром у вас запускается от имени администратора.</p><div class="quotebox"><cite>Michael пишет:</cite><blockquote><p>Или может есть идеи что можно было бы сделать вместе Edit?</p></blockquote></div><p>Я бы использовал ListView.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-03T14:16:58Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158015#p158015</id>
		</entry>
</feed>
