id.balandin
Новичок
- Сообщения
- 30
- Репутация
- 0
Собственно через CheckBox разобрался как запрашивать номер ОКПО с сайта. Решил сделать интерфейс к этому функционалу, но увы тут немного не понимаю.
Вообщем видимо проблема в цикле или с переменными?
Код:
#include <MsgBoxConstants.au3>
#include <IE.au3>
#include <Array.au3>
#include <String.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Узнай ОКПО", 484, 227, 192, 124)
$ButtonSearch = GUICtrlCreateButton("Поиск", 320, 64, 75, 25)
GUICtrlSetState(-1, $GUI_FOCUS)
$Input1 = GUICtrlCreateInput("", 192, 64, 129, 25, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
$Label1 = GUICtrlCreateLabel("Введи ИНН организации:", 64, 64, 133, 25, BitOR($SS_CENTER,$SS_CENTERIMAGE))
$Label2 = GUICtrlCreateLabel("Номер ОКПО:", 128, 104, 75, 25, $SS_CENTERIMAGE)
$Input2 = GUICtrlCreateInput("", 200, 104, 121, 25, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
$Button2 = GUICtrlCreateButton("Сброс", 395, 64, 75, 25)
GUICtrlSetState(-1, $GUI_FOCUS)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Do
$nMsg = GUIGetMsg()
If $msg = $ButtonSearch Then
Local $Form1 = $Input1
$oIE = _IECreate("http://212.104.73.202/ul/", 0, 0, 1, 1)
$oForm = _IEFormGetCollection ($oIE, 0)
$oInput =_IEGetObjByName($oIE,"p_text")
_IEFormElementSetValue ($oInput, $sForm1); вставляем ИНН
_IEFormSubmit ($oForm)
$sText = _IEBodyReadText($oIE); читаем что открылось на странице
$array = _StringBetween($sText, "Код ОКПО", "Наименование предприятия"); ищем номер в тексте
$string = _ArrayToString($array, @CRLF); х.з.
ClipPut($string);
$Input2( ClipGet())
_IEQuit($oIE)
EndIf
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Вообщем видимо проблема в цикле или с переменными?