ionmang20 Posted March 31, 2010 Posted March 31, 2010 I've made an application in AutoIt that notifies me of changes in my internet banking balance.Because I used unreliable commands like Send("{ENTER}")to hit Ok button, Send("User{TAB}Password{ENTER}") to enter the user name and password in a login form or ControlClick("Title", "","", "", 1, X, Y) to click on a link or button at x , y coordinates , I decided to improve my script with IE functions.I tried to apply IE functions to click the top Ok button from https://bt24.btrl.ro/bt24 like the picture below :#include $IE = _IECreate("https://bt24.btrl.ro/bt24", 0, 1, 0, 1) _IELoadWait ($IE) $ID = _IEGetObjByName($IE,"rghtsidbtna") _IEAction ($ID, "click") MsgBox(0, "Result", "IE " & $IE & @CRLF & "ID "& $ID & @CRLF & "Error " & @error)The object name “rghtsidbtna” I’ve got it with DebugBar and I hope it’s right : <IMG border=0 name=rghtsidbtna alt="" src="images/rghtsidbtna.gif" width=39 height=26>But the button isn't clicked (although I hear the clicking sound) and the variables $IE = “”, $ID= “”, @error = 0Can you tell me what I’ve done wrong and how can I click that button?
KaFu Posted March 31, 2010 Posted March 31, 2010 It's not a button, it's a picture with an underlying java-script... and as far as I can see on that page it doesn't trigger anything expect an img-change ? Nothing happens when I click on it and I can't see any trigger in the source too... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
ionmang20 Posted March 31, 2010 Author Posted March 31, 2010 It's not a button, it's a picture with an underlying java-scriptYes, you are right, it's picture, but how can I click on it ?and as far as I can see on that page it doesn't trigger anything expect an img-change ? Nothing happens when I click on it and I can't see any trigger in the source too...I don't understand why nothing happens, because when I click the Go picture next to login, it opens a pop up window https://bt24.btrl.ro/bt24/SSL/default.asp?Language=RomanianCan you try clicking on any of the Go pictures on the left, also them will do something ?
KaFu Posted March 31, 2010 Posted March 31, 2010 I see, might get killed by a pop-up blocker here ... seems like a static address to me... why don't you just use it as the start-page for _IECreate() directly? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
ionmang20 Posted March 31, 2010 Author Posted March 31, 2010 I see, might get killed by a pop-up blocker here ... seems like a static address to me... why don't you just use it as the start-page for _IECreate() directly?Yes, I could do that, but I what to learn how to do that with your help and because the access in the page is restricted by a certificate you cannot see the page in order to help me.So, how can I use the IE functions _IECreate, _IEGetObjByName and _IEAction or any other function to click on this page pictures ?
KaFu Posted March 31, 2010 Posted March 31, 2010 I tried _IEImgClick() which returns a -1 (success)... but nothing happens... strange ... maybe it has something to do with https protocol? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
ionmang20 Posted March 31, 2010 Author Posted March 31, 2010 I tried _IEImgClick() which returns a -1 (success)... but nothing happens... strange ... maybe it has something to do with https protocol? I tried with _IEImgClick,but it returns 0, did I do anything wrong ? #include <IE.au3> $IE = _IECreate("https://bt24.btrl.ro/bt24") _IELoadWait ($IE) _IEImgClick($IE,"rghtsidbtna","name") MsgBox(0, "Result", "IE " & $IE & @CRLF & "ID "& $ID & @CRLF & "Error " & @error)
DaleHohm Posted March 31, 2010 Posted March 31, 2010 No, the protocol is not the issue. You'll see that the img is nested in an <A> with a bunch of javascript tied to it... that is where the magic is happening. 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
ionmang20 Posted March 31, 2010 Author Posted March 31, 2010 No, the protocol is not the issue. You'll see that the img is nested in an <A> with a bunch of javascript tied to it... that is where the magic is happening. DaleI tried : #include <IE.au3> $IE = _IECreate("https://bt24.btrl.ro/bt24") _IELoadWait($IE) $ID = _IEGetObjByName($IE, "A") _IEImgClick($ID, "rghtsidbtna", "name") ... it doesn't click on the image and I get the following errors : --> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: A, Index: 0) --> IE.au3 V2.4-0 Error from function _IEImgClick, $_IEStatus_InvalidDataType How can I access the img in the <A> </A> ?
KaFu Posted March 31, 2010 Posted March 31, 2010 You'll see that the img is nested in an <A> with a bunch of javascript tied to it... that is where the magic is happening.DaleI fear that Dale means it's necessary to analyze the underlying javascript (saw a ref to a .js file at the top of the source) to emulate what's happening. So a click to an image is only meant literally and not really performed as by user input? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
ionmang20 Posted March 31, 2010 Author Posted March 31, 2010 I fear that Dale means it's necessary to analyze the underlying javascript (saw a ref to a .js file at the top of the source) to emulate what's happening. I noticed with DebugBar that onmousedown="changeImages('rghtsidbtna', 'images/rghtsidbtna-over.gif'); go_ib(); return true;" and so I downloaded the website with Teleport. In choosepg.js I founded : function go_ib() { var width, height; height = screen.availHeight - 40; width = screen.availWidth - 10; window.open('https://bt24.btrl.ro/bt24/SSL/default.asp?Language='+prev_language, 'IB', 'toolbar=no,resizable=yes,top=0,left=0,width='+width+',height='+height, ''); } ...now how can I run go_ib() function ? So a click to an image is only meant literally and not really performed as by user input? I'm affraid I don't understand the question. You mean I shouldn't click on the image and do something in order to get the same effect ?
KaFu Posted April 1, 2010 Posted April 1, 2010 You mean I shouldn't click on the image and do something in order to get the same effect ? Yeah, it seems to me that emulating the click does not trigger the underlying javascript... window.open('https://bt24.btrl.ro/bt24/SSL/default.asp?Language='+prev_language, 'IB', 'toolbar=no,resizable=yes,top=0,left=0,width='+width+',height='+height, ''); So why do you need to call the start-up page first? To acquire the certificate? Maybe something like this is sufficient too? #include <IE.au3> $oIE= _IECreate("https://bt24.btrl.ro/bt24") _IELoadWait($oIE) _IENavigate ($oIE, "https://bt24.btrl.ro/bt24/SSL/default.asp?Language=Romanian") or, if the target page checks for referer something like this... #include <IE.au3> $oIE = _IECreate("https://bt24.btrl.ro/bt24") $oBody = _IETagNameGetCollection($oIE, "body", 0) _IEDocInsertHTML($oBody, "<a id='custom_entry' href='https://bt24.btrl.ro/bt24/SSL/default.asp?Language=Romanian'>custom_entry</a>", "afterbegin") _IELinkClickByText ($oIE, "custom_entry") OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
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