Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;=> Coded by Juno_okyo (08/11/2014)
- ; Includes
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <Inet.au3>
- #include <Array.au3>
- #include <String.au3>
- #include <GuiEdit.au3>
- ; Options
- #NoTrayIcon
- Opt('WinTitleMatchMode', 2)
- Opt('GUIOnEventMode', 1)
- Opt('GUICloseOnESC', 0)
- ; Script Start - Add your code below here
- #Region ### START Koda GUI section ### Form=
- Global $FormMain = GUICreate("Get all links in website", 464, 381, -1, -1)
- GUISetFont(12, 400, 0, "Arial")
- GUISetOnEvent($GUI_EVENT_CLOSE, "FormMainClose")
- Global $Label1 = GUICtrlCreateLabel("URL:", 5, 10, 39, 22)
- Global $Input1 = GUICtrlCreateInput("", 50, 8, 340, 26)
- Global $Button1 = GUICtrlCreateButton("GET", 398, 8, 61, 25)
- GUICtrlSetOnEvent(-1, "Button1Click")
- GUICtrlSetCursor(-1, 0)
- Global $Edit1 = GUICtrlCreateEdit("", 5, 45, 453, 328)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- While 1
- Sleep(100)
- WEnd
- Func Button1Click()
- Local $url = GUICtrlRead($Input1)
- If $url = '' Then Return False
- GUICtrlSetState($Button1, 128)
- Local $source = _INetGetSource($url)
- Local $list_url = StringRegExp($source, '<a href="http.+">.+</a>', 3)
- If @error Then Return False
- Local $max = UBound($list_url) - 1
- For $i = 0 To $max
- Local $link = _StringBetween($list_url[$i], 'href="', '"')
- _GUICtrlEdit_AppendText($Edit1, $link[0] & @CRLF)
- Next
- GUICtrlSetState($Button1, 64)
- EndFunc
- Func FormMainClose()
- Exit
- EndFunc
Add Comment
Please, Sign In to add comment