Что нового

Достать текст из исходного кода страницы.

Fortuno

Новичок
Сообщения
5
Репутация
0
Приветствую!

Набросал простенькую программку.

Код:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
  
Opt("GUIOnEventMode", 1) 
$Form1_1 = GUICreate("LoLSearch", 250, 107, 518, 324)
$Searcher = GUICtrlCreateInput("", 8, 40, 233, 21)
$EnterNick = GUICtrlCreateLabel("Введите Ник", 80, 16, 66, 17)
$Find = GUICtrlCreateButton("Найти", 64, 72, 123, 25, $WS_GROUP)
$URL = "http://www.lolking.net/search?name="
GUICtrlSetOnEvent($Find, "Find") 
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") 
GUISetState(@SW_SHOW)

While 1 
  Sleep(10)  
WEnd 

Func Find()     
ShellExecute($URL & GUICtrlRead($Searcher))
EndFunc

Func CLOSEClicked()     
  Exit 
EndFunc


Вопрос такой.

Сейчас в скрипте по результатам поиска открывает страницу, у которой в исходном коде обязательно присутствует строка "summoner/euw/12345"
Я хочу добавить кнопку, которая находила бы эту строку и вставляла цифры из нее в текстовое поле.
Чтобы не вдаваться в пространные описания и объяснить понятней, я хочу чтобы программа выглядела так

Код:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Search", 170, 198, 192, 124)
GUICtrlCreateInput("", 24, 32, 121, 21)
$Button1 = GUICtrlCreateButton("Сформировать", 24, 64, 83, 25, $WS_GROUP)
GUICtrlCreateInput("", 24, 112, 121, 21)
$Find = GUICtrlCreateButton("Найти", 24, 144, 83, 25, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Введите Ник", 24, 8, 69, 17)
GUISetState(@SW_SHOW)


While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd
 
Автор
F

Fortuno

Новичок
Сообщения
5
Репутация
0
Да... Просьба модераторам перенести, тему создавал после работы, и соображал уже с трудом :whistle:
 
Верх