creeping Posted September 24, 2006 Share Posted September 24, 2006 Right, Im not too savy with HTML etc. Trying to make a script to check the security of ports on a router or PC etc. I downloaded IE-builder, have all the source etc and have tried many ways to click this button with no luck, due to my lack of understanding of IE COM objects and exactly what some of the IE.au3 functions are performing/returning and how I can use them..... blah blah. So the code I have so far was from trial and error. I would like to click on the button "All service Ports" Any ideas. Thanks #include <IE.au3> Opt("WinTitleMatchMode", 2) $IEtitle = "Microsoft Internet Explorer" $grcLink = "grc.com" $shieldsupBut = "su2blackglow.gif" $shieldsupLinkText = "ShieldsUP!" $oIE = _IECreate($grcLink, 0, 1, 1, 1) WinActivate($IEtitle, "") WinSetState($IEtitle, "", @SW_MAXIMIZE) _IEImgClick($oIE, $shieldsupBut, "src") _IELinkClickByText($oIE, $shieldsupLinkText) $oProceed = _IEGetObjByName($oIE, "12") _IEAction($oProceed, "click") _IELoadWait($oIE) Link to comment Share on other sites More sharing options...
AceLoc Posted September 24, 2006 Share Posted September 24, 2006 (edited) should be one of these^^_IEImgClick($oIE, "All Service Ports", "alt") _IEImgClick($oIE, "7", "name") _IEImgClick($oIE, "/image/pa_asp.gif", "src") _IEImgClick($oIE, "http://www.grc.com/image/pa_asp.gif") next time check help file before asking ! Edited September 24, 2006 by aceloc [quote name='AceLoc']I gots new sunglasses there cool.[/quote] Link to comment Share on other sites More sharing options...
creeping Posted September 24, 2006 Author Share Posted September 24, 2006 (edited) should be one of these^^_IEImgClick($oIE, "All Service Ports", "alt") _IEImgClick($oIE, "7", "name") _IEImgClick($oIE, "/image/pa_asp.gif", "src") _IEImgClick($oIE, "http://www.grc.com/image/pa_asp.gif") next time check help file before asking ! Ok, I had already tried all of those, whcih I thought would work but don't seem to. Thats why I thought I was missing something. Sorry, I should of stated what I had already tried The error messages when using those statements: --> IE.au3 Warning from function _IEImgClick, $_IEStatus_NoMatch --> IE.au3 Warning from function _IEImgClick, $_IEStatus_NoMatch --> IE.au3 Warning from function _IEImgClick, $_IEStatus_NoMatch --> IE.au3 Warning from function _IEImgClick, $_IEStatus_NoMatch Edited September 24, 2006 by creeping Link to comment Share on other sites More sharing options...
DaleHohm Posted September 24, 2006 Share Posted September 24, 2006 It looks like your _IEImgClick($oIE, $shieldsupBut, "src") works, but since it generates a navigation to a new page you need to put in an _IELoadWait($oIE) to insure the new page load completes before you try to access elements on it. 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...
creeping Posted September 25, 2006 Author Share Posted September 25, 2006 (edited) It looks like your _IEImgClick($oIE, $shieldsupBut, "src") works, but since it generates a navigation to a new page you need to put in an _IELoadWait($oIE) to insure the new page load completes before you try to access elements on it.DaleAh right, Thanks alot. Erm, still does not work though. Edited September 25, 2006 by creeping Link to comment Share on other sites More sharing options...
AceLoc Posted September 25, 2006 Share Posted September 25, 2006 Dale is always right.. he made IE.au3 [quote name='AceLoc']I gots new sunglasses there cool.[/quote] Link to comment Share on other sites More sharing options...
creeping Posted September 25, 2006 Author Share Posted September 25, 2006 Dale is always right.. he made IE.au3 I am aware of that aceloc, have you tried his suggestion? It looks like your _IEImgClick($oIE, $shieldsupBut, "src") works, but since it generates a navigation to a new page you need to put in an _IELoadWait($oIE) to insure the new page load completes before you try to access elements on it. I click shield's up button _IEImgClick($oIE, $shieldsupBut, "src") _IELoadWait($oIE) oÝ÷ Úw±¶ zZvÂ'$¢{!é]²êm{ZºÚ"µÍÒQS[ÐÛXÚÐU^ ÌÍÛÒQK ÌÍÜÚY[Ý[Õ^ BÒQSØYØZ] ÌÍÛÒQJH next page loads, try to click on "All service ports", does not work. I added _IELoadWait($oIE) after each page to make sure I was not missing one. Link to comment Share on other sites More sharing options...
AceLoc Posted September 25, 2006 Share Posted September 25, 2006 (edited) you could try something like: #include <IE.au3> Opt("WinTitleMatchMode", 2) $IEtitle = "Microsoft Internet Explorer" $grcLink = "grc.com" $shieldsupBut = "su2blackglow.gif" $shieldsupLinkText = "ShieldsUP!" $oProceed = _IEGetObjByName($oIE, "12") $oTest = "URL TO NEW PAGE" $oIE = _IECreate($grcLink, 0, 1, 1, 1) WinActivate($IEtitle, "") WinSetState($IEtitle, "", @SW_MAXIMIZE) _IEImgClick($oIE, $shieldsupBut, "src") _IELoadWait($oIE) _IELinkClickByText($oIE, $shieldsupLinkText) _IELoadWait($oIE) $oProceed = _IEGetObjByName($oIE, "12") _IEAction($oProceed, "click") _IELoadWait($oTest) Edited September 25, 2006 by aceloc [quote name='AceLoc']I gots new sunglasses there cool.[/quote] Link to comment Share on other sites More sharing options...
AceLoc Posted September 25, 2006 Share Posted September 25, 2006 (edited) Right, Im not too savy with HTML etc. Trying to make a script to check the security of ports on a router or PC etc.heheh.. why you use that site for it?? would be much.. much.. easier to do it like this: #NoTrayIcon HotKeySet("{DEL}", "_Exit") TCPStartUp() $g_IP = InputBox("Scan IP:", "IP:", "", "", 100, 10) $File = FileOpen("PortScan.txt", 2);open this .txt with wordpad.exe else it wont format good..... in wordpad it goes like "( IP | PORT | STATUS)" For $i = 1 To 10000;you can increase this ofcourse to how far you wanna scan. $socket = TCPConnect($g_IP, $i) If NOT @error Then FileWrite($File, $g_IP & " : " & $i & " : " & "OPEN" & @CR) Else FileWrite($File, $g_IP & " : " & $i & " : " & "CLOSED" & @CR) EndIf ToolTip($i & "/" & 10000, 0, 0);dont forget to edit this one then aswell If $i = 10000 Then;and this one :P FileClose($File) TCPShutdown() Exit EndIf Next Func _Exit() FileClose($File) TCPShutdown() Exit EndFunc shhhhhh ! scans port 1 Till 10000 ( on the filled in IP ) Edited September 25, 2006 by aceloc [quote name='AceLoc']I gots new sunglasses there cool.[/quote] Link to comment Share on other sites More sharing options...
creeping Posted September 25, 2006 Author Share Posted September 25, 2006 heheh.. why you use that site for it?? would be much.. much.. easier to do it like this: #NoTrayIcon HotKeySet("{DEL}", "_Exit") TCPStartUp() $g_IP = InputBox("Scan IP:", "IP:", "", "", 100, 10) $File = FileOpen("PortScan.txt", 2);open this .txt with wordpad.exe else it wont format good..... in wordpad it goes like "( IP | PORT | STATUS)" For $i = 1 To 10000;you can increase this ofcourse to how far you wanna scan. $socket = TCPConnect($g_IP, $i) If NOT @error Then FileWrite($File, $g_IP & " : " & $i & " : " & "OPEN" & @CR) Else FileWrite($File, $g_IP & " : " & $i & " : " & "CLOSED" & @CR) EndIf ToolTip($i & "/" & 10000, 0, 0);dont forget to edit this one then aswell If $i = 10000 Then;and this one :P FileClose($File) TCPShutdown() Exit EndIf Next Func _Exit() FileClose($File) TCPShutdown() Exit EndFunc shhhhhh ! scans port 1 Till 10000 ( on the filled in IP ) Hmm yea, that an idea, thanks for the input. Reason was company policy.. so yea thought i would just automate it Link to comment Share on other sites More sharing options...
AceLoc Posted September 25, 2006 Share Posted September 25, 2006 welcome [quote name='AceLoc']I gots new sunglasses there cool.[/quote] Link to comment Share on other sites More sharing options...
DaleHohm Posted September 25, 2006 Share Posted September 25, 2006 On a good day, I'm often right, but sometime I misunderstand the question and then I'm always wrong In this case, I'm not sure I understand the question... I used the code below and everything seems to work fine. You talk about clicking on a ShieldsUp "button" -- I'm not sure what you mean and I don't see anything on the screen that looks like such a button. Can you explain this last piece? Dale #include <IE.au3> Opt("WinTitleMatchMode", 2) $IEtitle = "Microsoft Internet Explorer" $grcLink = "grc.com" $shieldsupBut = "su2blackglow.gif" $shieldsupLinkText = "ShieldsUP!" $oIE = _IECreate($grcLink, 0, 1, 1, 1) WinActivate($IEtitle, "") WinSetState($IEtitle, "", @SW_MAXIMIZE) _IEImgClick($oIE, $shieldsupBut, "src") _IELoadWait($oIE) _IELinkClickByText($oIE, $shieldsupLinkText) _IELoadWait($oIE) $oProceed = _IEGetObjByName($oIE, "12") _IEAction($oProceed, "click") _IELoadWait($oIE) 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...
creeping Posted September 25, 2006 Author Share Posted September 25, 2006 On a good day, I'm often right, but sometime I misunderstand the question and then I'm always wrong In this case, I'm not sure I understand the question... I used the code below and everything seems to work fine. You talk about clicking on a ShieldsUp "button" -- I'm not sure what you mean and I don't see anything on the screen that looks like such a button. Can you explain this last piece? Dale #include <IE.au3> Opt("WinTitleMatchMode", 2) $IEtitle = "Microsoft Internet Explorer" $grcLink = "grc.com" $shieldsupBut = "su2blackglow.gif" $shieldsupLinkText = "ShieldsUP!" $oIE = _IECreate($grcLink, 0, 1, 1, 1) WinActivate($IEtitle, "") WinSetState($IEtitle, "", @SW_MAXIMIZE) _IEImgClick($oIE, $shieldsupBut, "src") _IELoadWait($oIE) _IELinkClickByText($oIE, $shieldsupLinkText) _IELoadWait($oIE) $oProceed = _IEGetObjByName($oIE, "12") _IEAction($oProceed, "click") _IELoadWait($oIE) Ok. I would like to navigate to: grc.com then click on the image: http://www.grctech.com/_kgvanpkvcn3rf_/ima...u2blackglow.gif (see below) doing this naviagtes to: http://www.grc.com/default.htm Then I want to simulate a click on the red underlined text "ShieldsUP!" about half way down the page. doing this naviagates to the page: https://www.grc.com/x/ne.dll?bh0bkyd2 Then I want to click to the "Proceed" button which naviagtes to the page: http://www.grc.com/x/ne.dll?rh1dkyd2 Here I would like to click on the button/text/thing that says: "All service ports" But I can not simulate this click on the "All service ports" button, does not seem to work for me Link to comment Share on other sites More sharing options...
DaleHohm Posted September 26, 2006 Share Posted September 26, 2006 Ok, I see it now. That is not a regular image, but rather a Form Input type=image element. Please see _IEFormImageClick 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...
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