<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Открывать страницу по номеру]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=17545</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=17545&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Открывать страницу по номеру».]]></description>
		<lastBuildDate>Thu, 12 Jan 2023 22:12:18 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Открывать страницу по номеру]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156263#p156263</link>
			<description><![CDATA[<div class="quotebox"><cite>jbn238 пишет:</cite><blockquote><p>я когда-то подобное делал через RegExMatch, загружал html, и там по ключевым словам находил нужные данные, тут так же выйдет?</p></blockquote></div><p>Попробуйте, почему нет. Но не всегда данные можно получить таким способом, часть данных иногда подгружается уже после загрузки страницы, так что в исходном html их может не быть.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 12 Jan 2023 22:12:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156263#p156263</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открывать страницу по номеру]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156261#p156261</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />А ещё вот такой вопрос, когда открыло страницу с нужным игроком, снизу есть таблица <a href="https://prnt.sc/fikGj0IeO3w6">https://prnt.sc/fikGj0IeO3w6</a>, то что красным нужно в чтобы выводило в Gui, но для этого нужно чтобы эти данные принимались в переменные, как это лучше сделать, я когда-то подобное делал через RegExMatch, загружал html, и там по ключевым словам находил нужные данные, тут так же выйдет?</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p>Это наверное как второй вопрос можно расценивать, но это же один функционал программы, поэтому написал сюда).</p><p>Ссылка на таблицу если надо вдруг.<br /><a href="https://www.tennisabstract.com/cgi-bin/wplayer.cgi?p=IgaSwiatek#career-splits-h">https://www.tennisabstract.com/cgi-bin/ … r-splits-h</a></p></div></div>]]></description>
			<author><![CDATA[null@example.com (jbn238)]]></author>
			<pubDate>Thu, 12 Jan 2023 21:59:48 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156261#p156261</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открывать страницу по номеру]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156260#p156260</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Если честно, оба варианты для меня не понятны, но большое спасибо за помощь, работоспособность это главное, а понимание кода уже можно отложить).</p>]]></description>
			<author><![CDATA[null@example.com (jbn238)]]></author>
			<pubDate>Thu, 12 Jan 2023 21:54:23 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156260#p156260</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открывать страницу по номеру]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156259#p156259</link>
			<description><![CDATA[<p>Можно попроще:<br /></p><div class="codebox"><pre><code>url := &quot;https://tennisabstract.com/reports/wtaRankings.html&quot;
inputbox, position,,,, 100, 100,,,,, 1

html := WebRequest(url,,,, error)
if error
   throw error
document := DocumentFromHtml(html)
links := document.querySelectorAll(&quot;table#reportable tr td[align=&quot;&quot;left&quot;&quot;] &gt; a&quot;)

Loop % links.Length {
   link := links[A_Index - 1]
   if (A_Index = position)
      Run % link.href
}

WebRequest(url, method := &quot;GET&quot;, HeadersArray := &quot;&quot;, body := &quot;&quot;, ByRef error := &quot;&quot;) {
   Whr := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
   Whr.Open(method, url, true)
   for name, value in HeadersArray
      Whr.SetRequestHeader(name, value)
   Whr.Send(body)
   Whr.WaitForResponse()
   status := Whr.status
   if (status != 200)
      error := &quot;HttpRequest error, status: &quot; . status
   Arr := Whr.responseBody
   pData := NumGet(ComObjValue(Arr) + 8 + A_PtrSize)
   length := Arr.MaxIndex() + 1
   Return StrGet(pData, length, &quot;UTF-8&quot;)
}

DocumentFromHtml(html, mode := 9) {
   document := ComObjCreate(&quot;HTMLFILE&quot;)
   document.write(&quot;&lt;meta http-equiv=&quot;&quot;X-UA-Compatible&quot;&quot; content=&quot;&quot;IE=&quot; . mode . &quot;&quot;&quot;&gt;&quot;)
   document.write(html)
   Return document
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 12 Jan 2023 21:48:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156259#p156259</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открывать страницу по номеру]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156258#p156258</link>
			<description><![CDATA[<p><strong>inseption86</strong><br />Спасибо большое, то что нужно!</p>]]></description>
			<author><![CDATA[null@example.com (jbn238)]]></author>
			<pubDate>Thu, 12 Jan 2023 21:35:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156258#p156258</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открывать страницу по номеру]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156247#p156247</link>
			<description><![CDATA[<p><strong>jbn238</strong></p><div class="codebox"><pre><code>
#NoEnv
SetBatchLines, -1
#SingleInstance force


url := &quot;https://tennisabstract.com/reports/wtaRankings.html&quot;
inputbox, position, , , ,100 ,100,, , , , ***


HTTP := ComObjCreate(&quot;WinHTTP.WinHttpRequest.5.1&quot;)
HTTP.Open(&quot;GET&quot;, url)
HTTP.SetRequestHeader(&quot;User-Agent&quot;, &quot;Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36&quot;)
HTTP.Send()
HTTP.WaitForResponse()

body := HTTP.ResponseBody
pdata := NumGet(ComObjValue(body) + 8 + A_PtrSize)
length := body.MaxIndex() - body.MinIndex() + 1
text := StrGet(pdata, length, &quot;cp1251&quot;)
html := ComObjCreate(&quot;HTMLFile&quot;)
html.write(text)

loop, % html.getElementsByTagName(&quot;tbody&quot;)[3].getElementsByTagName(&quot;tr&quot;).length
{
   if(position = html.getElementsByTagName(&quot;tbody&quot;)[3].getElementsByTagName(&quot;tr&quot;)[A_index - 1].getElementsByTagName(&quot;td&quot;)[0].innerText)
   {
      run, % html.getElementsByTagName(&quot;tbody&quot;)[3].getElementsByTagName(&quot;tr&quot;)[A_index - 1].getElementsByTagName(&quot;td&quot;)[1].getElementsByTagName(&quot;a&quot;)[0].getAttribute(&quot;href&quot;)
      break
   }
}
ExitApp
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (inseption86)]]></author>
			<pubDate>Thu, 12 Jan 2023 05:26:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156247#p156247</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открывать страницу по номеру]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156246#p156246</link>
			<description><![CDATA[<p>Если есть базовые знания по веб-разработке, можно создать документ из html и распарсить джаваскриптом.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 12 Jan 2023 00:46:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156246#p156246</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открывать страницу по номеру]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156245#p156245</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Это да, я сам думал так, сама проблема как распарсить, чтобы всё было коректно? <br /></p><div class="codebox"><pre><code>
UrlDownloadToFile, https://tennisabstract.com/reports/wtaRankings.html, 0.txt
InputBox, num, Номер,,, 200, 120
RegExMatch 
</code></pre></div><p>На моменте &quot;RegExMatch &quot; начинается основная проблема.</p>]]></description>
			<author><![CDATA[null@example.com (jbn238)]]></author>
			<pubDate>Wed, 11 Jan 2023 23:51:48 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156245#p156245</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открывать страницу по номеру]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156244#p156244</link>
			<description><![CDATA[<p>Легко. Посылаете http-запрос, получаете html, там вся таблица. Остаётся распарсить.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 11 Jan 2023 23:45:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156244#p156244</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открывать страницу по номеру]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156243#p156243</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Не нужно, спасибо). Поможете с решением?</p>]]></description>
			<author><![CDATA[null@example.com (jbn238)]]></author>
			<pubDate>Wed, 11 Jan 2023 23:37:23 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156243#p156243</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открывать страницу по номеру]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156240#p156240</link>
			<description><![CDATA[<p><strong>jbn238</strong>, точку опять потеряли. Дать ссылку на правила?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 11 Jan 2023 00:28:37 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156240#p156240</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Открывать страницу по номеру]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156239#p156239</link>
			<description><![CDATA[<p>Доброго времени!<br />Помогите с решением, я ввожу число 19, после на этой странице <a href="https://tennisabstract.com/reports/wtaRankings.html">https://tennisabstract.com/reports/wtaRankings.html</a><br />под номером 19 стоит &quot;Liudmila Samsonova&quot;, вот её и должна открывать программа, как такое реализовать? То есть, я просто в InputBox пишу число 19, и мне сразу открывает страницу <a href="https://www.tennisabstract.com/cgi-bin/wplayer.cgi?p=LiudmilaSamsonova">https://www.tennisabstract.com/cgi-bin/ … aSamsonova</a>, и так же с остальными номерами, помогите пожалуйста.</p>]]></description>
			<author><![CDATA[null@example.com (jbn238)]]></author>
			<pubDate>Tue, 10 Jan 2023 22:15:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156239#p156239</guid>
		</item>
	</channel>
</rss>
