rudi Posted July 13, 2009 Share Posted July 13, 2009 Hi. The IE functions of Autoit definitely are not what I know much about, so pls. be patient , I honestly have no clue how to do a http POST (?) and how to catch and analyse the resulting page returned by the web server using Autoit. Surfcontrol is a product for content filtering at firewalls / proxies. URLs are categorized, categories can be allowed or denied for certain users, groups, ... . To make it easier to find out, why a certain site is blocked, surfcontrol is providing this page: http://mtas2.surfcontrol.com/mtas/MTASNovellv6.1.asp When entering a certain URL, the returning result is either "... is not in our list", or " ...is in our list and categorized as <category>". I'd like to write a small applet, that directly just returns this result: start, run, surfcontrol[.exe] <site-to-be-checked>, OK, msgbox popping up telling the result, no IE window opening at all. Where to read up / check out how to solve this propably pretty basic task? Thanks for any suggestions to point me in the right direction. Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Rkey Posted July 13, 2009 Share Posted July 13, 2009 Can't you just open IE in the background and catch the result and then close it. I assume a standard page is shown when the URL is blocked, so if URL is blocked show x else y. Check IE Management in the helpfile Link to comment Share on other sites More sharing options...
DaleHohm Posted July 13, 2009 Share Posted July 13, 2009 You may be able to use InetGet if they are static pages not needing authentication. If not, see _IECreate with the invisible flag, _IEBodyReadText and _IEQuit Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
rudi Posted July 16, 2009 Author Share Posted July 16, 2009 Hi.You may be able to use InetGet if they are static pages not needing authentication.This page looks static. It's a form with one edit and one button. What I would need is to know how to "directly" send the POST (?) that IE is doing after I fill the form and press the button.If not, see _IECreate with the invisible flag, _IEBodyReadText and _IEQuitI played with _IE*, but failed deperately Thanks for your reply, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
KaFu Posted July 16, 2009 Share Posted July 16, 2009 (edited) Here's a start... #include <IE.au3> $oIE = _IECreate ("http://mtas2.surfcontrol.com/mtas/MTASV4.asp",0,0) $oForm = _IEFormGetObjByName ($oIE, "form1") $oQuery = _IEFormElementGetObjByName ($oForm, "url") _IEFormElementSetValue ($oQuery, "http://www.bangbros.com") _IEFormSubmit ($oForm) $body = _IEBodyReadHTML($oIE) ConsoleWrite(_IEQuit($oIE) & @crlf) MsgBox(0,"",$body) Edited July 16, 2009 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
rudi Posted July 20, 2009 Author Share Posted July 20, 2009 (edited) Hi. Thanks a lot for you help! May be someone else also want's to use this currently working script: (until the next redesign of the answer page ...) expandcollapse popup#include <IE.au3> If $cmdline[0] <> 1 Then Info() Dim $CategoryLine = "" $h = 200 $w = 500 $title="Surfcontrol Checker" $myGUI = GUICreate($title, $w, $h) $LabelTXT = "Please wait, checking SurfControl v6.1 for BorderManager DB for " & @CRLF & @CRLF & '"'& $cmdline[1]& '"' & @CRLF & @CRLF & "Please be patient ..." $label = GUICtrlCreateLabel($LabelTXT, 20, 20, $w - 40, $h - 40) GUISetState(@SW_SHOW) $oIE = _IECreate("http://mtas2.surfcontrol.com/mtas/MTASV4.asp", 0, 0) $oForm = _IEFormGetObjByName($oIE, "form1") $oQuery = _IEFormElementGetObjByName($oForm, "url") _IEFormElementSetValue($oQuery, $cmdline[1]) _IEFormSubmit($oForm) $body = _IEBodyReadHTML($oIE) $BodyArr = StringSplit($body, @CRLF) For $i = 1 To $BodyArr[0] If StringInStr($BodyArr[$i], "is in our list and categorized as") Then $CategoryLine = $BodyArr[$i] ExitLoop EndIf Next GUIDelete($myGUI) If $CategoryLine == "" Then MsgBox(0, $title, $cmdline[1] & " is not in our list.") Else $result = StringRegExpReplace($CategoryLine, "(<(.|\n)*?>)", "") $result = StringRegExpReplace($result, "(.*?)(?i)(?: if you would like.*$)", "$1") $result = StringReplace($result,"&","&") MsgBox(0, $title, $result & ".") EndIf Func Info() MsgBox(0, "SurfControl Checker: Lookup Applet for Version 6.1 for Novell Bordermanager", _ "To lookup, what's the category for the site www.google.de use this syntax:" & @LF & @LF & _ StringRegExpReplace(@ScriptName, "(\..*)", "") & " www.google.de" & @LF, 20) Exit EndFunc ;==>Info Regards, Rudi. [edit: grammar] [edit2: "&" -> "&"] Edited July 20, 2009 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now