<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK_Загрузка файла через Chrome.ahk]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16230&amp;type=atom" />
	<updated>2021-04-04T09:12:26Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16230</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK_Загрузка файла через Chrome.ahk]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147160#p147160" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>&nbsp; Спасибо!</p><div class="codebox"><pre><code>Page.Call(&quot;Browser.setDownloadBehavior&quot;, { behavior : &quot;allow&quot;, downloadPath : &quot;C:\temp&quot;})   </code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2021-04-04T09:12:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147160#p147160</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK_Загрузка файла через Chrome.ahk]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147145#p147145" />
			<content type="html"><![CDATA[<p>Да, надо в Capabilities это прописать. Погуглите.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2021-04-03T16:57:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147145#p147145</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK_Загрузка файла через Chrome.ahk]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147144#p147144" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong><br />Переделал на chrome.ahk</p><div class="codebox"><pre><code>
RegWrite, REG_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, {374DE290-123F-4565-9164-39C4925E467B}, % folder_end

loop % Page.Evaluate(&quot;document.querySelectorAll(&#039;#apexir_ACTIONSMENU &gt; li&#039;).length&quot;).Value
{
	If InStr(Page.Evaluate(&quot;document.querySelectorAll(&#039;#apexir_ACTIONSMENU &gt; li&#039;)[ &quot; A_index &quot; - 1 ].innerText&quot;).value, &quot;Выгрузить&quot;)
	{
		Page.Evaluate(&quot;document.querySelectorAll(&#039;#apexir_ACTIONSMENU &gt; li&#039;)[ &quot; A_index &quot; - 1 ].lastChild.click()&quot;)
	    Page.WaitForLoad()
	}
}

MostRecentTime:=
FormatTime, TimeString_time, , HH-mm-ss


while FileExist(folder_end &quot;\*.CRDownload&quot;)
    Sleep 300
	

loop, % folder_end &quot;\*.csv&quot;
{
	FileGetTime, ThisFileTime
	if (MostRecentTime &lt; ThisFileTime)
		{
			MostRecentTime := ThisFileTime
			FilePath:= A_LoopFileFullPath
		}
}
if (FilePath != &quot;&quot;)
    FileMove, % FilePath, % folder_end &quot;\Отчёт_&quot; name &quot;_&quot; TimeString_time &quot;.csv&quot;

</code></pre></div><p>Но по умолчанию стоит &quot; Автоматическое скачивание -&nbsp; Спрашивать (по умолчанию)&quot;, возможно ли это обойди?</p>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2021-04-03T16:25:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147144#p147144</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK_Загрузка файла через Chrome.ahk]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147137#p147137" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong> Написал в техподдержку &quot;mos.ru&quot;, возможно ли выгружать отчёты через их Api, пока молчание,</p>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2021-04-02T15:28:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147137#p147137</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK_Загрузка файла через Chrome.ahk]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147136#p147136" />
			<content type="html"><![CDATA[<p>Мне кажется, что вы напрасно тратите время на подобные вопросы.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2021-04-02T15:20:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147136#p147136</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK_Загрузка файла через Chrome.ahk]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147135#p147135" />
			<content type="html"><![CDATA[<p>Добрый день! Возможно ли скачать файл по ссылке ( ссылка всегда разная и имеет вид &quot;; &quot;https://ise.mos.ru/euchet/f?p=185:7071:1468461501878501:CSV::::&quot;), которая привязывается к аккаунту при входе? Данный споспоб не работает!</p><div class="codebox"><pre><code>

URL := &quot;https://ise.mos.ru/euchet/f?p=185:LOGIN:0&quot;

ie := ComObjCreate(&quot;InternetExplorer.Application&quot;)
ie.Navigate(URL)
while ie.readystate &lt;&gt; 4
	continue
sleep 500

......................
url_file := % &quot;https://ise.mos.ru/euchet/&quot; ie.document.getElementById(&quot;apexir_dl_CSV&quot;).getAttribute(&quot;href&quot;)   
 
outputCSVFile := &quot;C:\temp\1.csv&quot;
		
Download(url_file,outputCSVFile,True,customHeaders,&quot;GET&quot;)

customHeaders := {&quot;User-Agent&quot;: &quot;Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0&quot;
		 ,&quot;Cache-Control&quot;: &quot;max-age=0&quot;
		 ,&quot;Cookie&quot;: ie.document.cookie}


</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2021-04-02T15:17:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147135#p147135</id>
		</entry>
</feed>
