xiantez Posted January 24, 2016 Posted January 24, 2016 Hello AutoIT community. I am attempting to make a script that will login to my bank account and retrieve one of my account balances and display it in a MsgBox, however it am having some difficulty getting the correct value.... The MsgBox keep displaying a value of "0" instead of the actual string in between the source code I'm looking for.... Any help would be greatly appreciated! $readtext = InetRead("https://www.xxxbanksitexxx.com/das/cgi-bin/session.cgi?screenid=SIGNON_PORTAL_PAUSE&LOB=CONS",1) $source = BinaryToString($readtext) $text = _StringBetween($source,'CHECKING XXXXXXXXXX ', ' "> ') MsgBox(0,"balance",$text) ;This keeps returning a value of "0" Case $GUI_EVENT_CLOSE GUIDelete($Form1) ExitLoop Case $Button2 GUIDelete($Form1) ExitLoop EndSwitch WEnd
Danyfirex Posted January 24, 2016 Posted January 24, 2016 (edited) HI. _StringBetween return an array. try this way to see whole array. $readtext = InetRead("https://www.xxxbanksitexxx.com/das/cgi-bin/session.cgi?screenid=SIGNON_PORTAL_PAUSE&LOB=CONS",1) $source = BinaryToString($readtext) $text = _StringBetween($source,'CHECKING XXXXXXXXXX ', ' "> ') _ArrayDisplay($text) Case $GUI_EVENT_CLOSE GUIDelete($Form1) ExitLoop Case $Button2 GUIDelete($Form1) ExitLoop EndSwitch WEnd You should include #include <Array.au3> for use _arraydisplay Saludos Edited January 24, 2016 by Danyfirex Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
xiantez Posted January 24, 2016 Author Posted January 24, 2016 (edited) Hi DanyFirex, Thank you for your suggestion, however when i use _ArrayDisplay($text) I do not see anything on my screen.... Is there another command i need to do to see this text pop up? Here is what I have now $readtext = InetRead("https:/xxxbanksitexxx.com/das/cgi-bin/session.cgi?screenid=SIGNON_PORTAL_PAUSE&LOB=CONS",1) $source = BinaryToString($readtext) $text = _StringBetween($source,'CHECKING XXXXXXXXXX ','">') _ArrayDisplay($text) Edited January 24, 2016 by xiantez
Gianni Posted January 24, 2016 Posted January 24, 2016 (edited) If the _ArrayDisplay() function doesn't show anyting is because $text is not an array, and if is not an array is because the _StringBetween() function has found nothing. Perhaps the start and end parameters that you use in the _StringBetween() function will not catch any string, try to use only "'CHECKING" as The beginning of the string to find and see if it will catch something. Try this snippet to do a little debug: #include <Array.au3> #include <String.au3> $readtext = InetRead("https:/xxxbanksitexxx.com/das/cgi-bin/session.cgi?screenid=SIGNON_PORTAL_PAUSE&LOB=CONS", 1) $source = BinaryToString($readtext) $text = _StringBetween($source, 'CHECKING', '">') If Not IsArray($text) Then MsgBox(0, "Debug", "No string found by _StringBetween()") Else _ArrayDisplay($text) EndIf Edited January 24, 2016 by Chimp Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
AutoBert Posted January 24, 2016 Posted January 24, 2016 Have you checked the result of InetRead? $readtext = InetRead("https://www.xxxbanksitexxx.com/das/cgi-bin/session.cgi?screenid=SIGNON_PORTAL_PAUSE&LOB=CONS",1) $source = BinaryToString($readtext) MsgBox(0,"Whole Text",$source) ;This keeps returning a value of "0" $text = _StringBetween($source,'CHECKING XXXXXXXXXX ', ' "> ') MsgBox(0,"balance",$text[0]) ;This keeps returning a value of "0"
Danyfirex Posted January 24, 2016 Posted January 24, 2016 try to create a file with downloaded data and check if the field you need exist. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
xiantez Posted January 24, 2016 Author Posted January 24, 2016 9 hours ago, Chimp said: If the _ArrayDisplay() function doesn't show anyting is because $text is not an array, and if is not an array is because the _StringBetween() function has found nothing. Perhaps the start and end parameters that you use in the _StringBetween() function will not catch any string, try to use only "'CHECKING" as The beginning of the string to find and see if it will catch something. Try this snippet to do a little debug: #include <Array.au3> #include <String.au3> $readtext = InetRead("https:/xxxbanksitexxx.com/das/cgi-bin/session.cgi?screenid=SIGNON_PORTAL_PAUSE&LOB=CONS", 1) $source = BinaryToString($readtext) $text = _StringBetween($source, 'CHECKING', '">') If Not IsArray($text) Then MsgBox(0, "Debug", "No string found by _StringBetween()") Else _ArrayDisplay($text) EndIf I think you are on to something Chimp.... My MsgBox was triggered due to not finding a string in the $source.... interesting.... I have questioned whether or not my InetRead is working properly.... I am not sure what source code I should be using now, i figured I could just log into my account, right click the main page and "get source code" would suffice..... I guess not.... =\
xiantez Posted January 24, 2016 Author Posted January 24, 2016 7 hours ago, AutoBert said: Have you checked the result of InetRead? $readtext = InetRead("https://www.xxxbanksitexxx.com/das/cgi-bin/session.cgi?screenid=SIGNON_PORTAL_PAUSE&LOB=CONS",1) $source = BinaryToString($readtext) MsgBox(0,"Whole Text",$source) ;This keeps returning a value of "0" $text = _StringBetween($source,'CHECKING XXXXXXXXXX ', ' "> ') MsgBox(0,"balance",$text[0]) ;This keeps returning a value of "0" AutoBert, I am going to do this next... Thanks!!!
xiantez Posted January 24, 2016 Author Posted January 24, 2016 (edited) Well.... This is strange..... I checked the results of my InetRead and used WriteFile.... The source code is not at all what I expected.... It is not even the same source code that I see when I "view source code" from my browser.... Grrrr, thats annoying lollll I could only imagine they might be embedding this stuff into an applet or something... I did notice that when i view my checking account, the session ID in the URL changes constantly.... This is pretty standard in embedded applications via web front ends... I have no clue how to get around that though.... Here are the results of my INetRead when i write it into an html file... Edited January 24, 2016 by xiantez
Danyfirex Posted January 24, 2016 Posted January 24, 2016 Of course. you need credentials. try to use IE. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
xiantez Posted January 24, 2016 Author Posted January 24, 2016 5 minutes ago, Danyfirex said: Of course. you need credentials. try to use IE. Saludos Yes, my script already knows how to log in and pass credentials.... that part works fine.... it not until it attempts to retrieve the source code is when i get those INetResults... I need to find a way to attach it to an existing session ID.... Because when my script makes the INetRead or _IEGetSource call, the website doesn't recognize the call from an existing session ID, thus timing me out.... I did find a work around using the following code $rText = _IEBodyReadText($oIE) FileWrite("source.txt",$rText) Then I can just read the text from the file and output it to a msgbox.... Not my ideal way of doing it, but it works for now...
Danyfirex Posted January 24, 2016 Posted January 24, 2016 You dont need to write to a file. you can use $rText with _StringBetween Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
xiantez Posted January 24, 2016 Author Posted January 24, 2016 3 minutes ago, Danyfirex said: You dont need to write to a file. you can use $rText with _StringBetween Saludos Haha funny you said that... I just realized that... make those changes now! =)
xiantez Posted January 24, 2016 Author Posted January 24, 2016 I finally got the _ArrayDisplay to work... However it is putting the entire string in 1 row 1 column.... How do I manipulate the rows and colums so I can have a row for each account (checking, saving, ect)
Danyfirex Posted January 24, 2016 Posted January 24, 2016 You can use _arrayadd Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
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