DarkCloud Posted January 7, 2009 Share Posted January 7, 2009 (edited) I *** out a important url =) but uh, basically there is something wrong with my stringsplit, that I can't figure out. The text it's suppose to be parsing is :: Logging in... OK sending a picture...got text for id=102/28934, type=0, to=0, text='garages explana' I need it to ignore everything but whats inbetween the '' example : garages explana ignore the stupid "do" loop i got =) Thanks for your help! #Include <ScreenCapture.au3> #Include "ie.au3" opt("WinTitleMatchMode", 2) $YesID = 'HaHa' Do WinWaitActive("Enter captcha for ") $hGUI = wingethandle("Enter captcha for ") _ScreenCapture_CaptureWnd ("C:\xampp\htdocs\1.jpg", $hGUI) $oIE = _iecreate("http://******/bot/captcha/getCaptcha.php?url=http://91.121.175.94/1.jpg") $text = _IEDocReadHTML ($oIE) $d = stringsplit( $text, "'" ) $d = stringsplit( $d[2], "'" ) $text = $d[1]; msgbox (0,"", $d) $YesID = 'NoNo' until $YesID == 'NoNo' Edited January 8, 2009 by DarkCloud Link to comment Share on other sites More sharing options...
martin Posted January 7, 2009 Share Posted January 7, 2009 I *** out a important url =) but uh, basically there is something wrong with my stringsplit, that I can't figure out. The text it's suppose to be parsing is :: Logging in... OK sending a picture...got text for id=102/28934, type=0, to=0, text='garages explana' I need it to ignore everything but whats inbetween the '' example : garages explana ignore the stupid "do" loop i got =) Thanks for your help! #Include <ScreenCapture.au3> #Include "ie.au3" opt("WinTitleMatchMode", 2) $YesID = 'HaHa' Do WinWaitActive("Enter captcha for ") $hGUI = wingethandle("Enter captcha for ") _ScreenCapture_CaptureWnd ("C:\xampp\htdocs\1.jpg", $hGUI) $oIE = _iecreate("http://******/bot/captcha/getCaptcha.php?url=http://91.121.175.94/1.jpg") $text = _IEDocReadHTML ($oIE) $d = stringsplit( $text, "'" ) $d = stringsplit( $d[2], "'" ) $text = $d[1]; msgbox (0,"", $d) $YesID = 'NoNo' until $YesID == 'NoNo'Well we can't test that so maybe you could use #include <string.au3> ; ; $StringIwant = _StringBetween($text,"text='","'") Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
DarkCloud Posted January 7, 2009 Author Share Posted January 7, 2009 (edited) I tried this, but the message box comes up blank.. Thanks for the fast reply and idea =) #Include <ScreenCapture.au3> #Include "ie.au3" #include <string.au3> opt("WinTitleMatchMode", 2) $YesID = 'HaHa' Do WinWaitActive("Enter captcha for ") $hGUI = wingethandle("Enter captcha for ") _ScreenCapture_CaptureWnd ("C:\xampp\htdocs\1.jpg", $hGUI) $oIE = _iecreate("http://66.90.101.177/bot/captcha/getCaptcha.php?url=http://91.121.175.94/1.jpg") $text = _IEDocReadHTML ($oIE) $StringIwant = _StringBetween($text,"text='","'") msgbox (0,"", $StringIwant) $YesID = 'NoNo' until $YesID == 'NoNo' Edited January 8, 2009 by DarkCloud Link to comment Share on other sites More sharing options...
DarkCloud Posted January 8, 2009 Author Share Posted January 8, 2009 (edited) Iv setup a another script that im using to trouble shoot, and I still can't get it working properly. #include <IE.au3> #Include <String.au3> #Include <array.au3> $oIE = _IECreate ("") _IENavigate ($oIE, "http://91.121.175.94/test.html", 1) $sHTML = _IEBodyReadHTML ($oIE) sleep(5000) $test1 = _StringBetween($sHTML, "text='", "'") msgbox(0,"",$test1) The msgbox comes up empty. Can anyone please help me?! Edited January 8, 2009 by DarkCloud Link to comment Share on other sites More sharing options...
qazwsx Posted January 8, 2009 Share Posted January 8, 2009 (edited) what is the value of $sHTML? Also, use code tags. Edited January 8, 2009 by qazwsx Link to comment Share on other sites More sharing options...
DarkCloud Posted January 8, 2009 Author Share Posted January 8, 2009 Should be :: Logging in... OK sending a picture...got text for id=102/39264, type=0, to=0, text='garages exolana' Im trying to grab the end words garages exolana Link to comment Share on other sites More sharing options...
qazwsx Posted January 8, 2009 Share Posted January 8, 2009 (edited) Success: A 0 based $array[0] contains the first found string. try $test1[0] in the msgbox. Fixed typo: @ to $ Edited January 8, 2009 by qazwsx Link to comment Share on other sites More sharing options...
DarkCloud Posted January 8, 2009 Author Share Posted January 8, 2009 No luck, i also erased the "#Include <array.au3>". Any other ideas? Link to comment Share on other sites More sharing options...
BrettF Posted January 8, 2009 Share Posted January 8, 2009 Works for me... $test = "Logging in... OK sending a picture...got text for id=102/39264, type=0, to=0, text='garages exolana'" $array = StringRegExp($test, "text='(.*?)'", 1) For $i = 0 To UBound($array) - 1 MsgBox(0, "RegExp Test" & $i, $array[$i]) Next Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
DarkCloud Posted January 8, 2009 Author Share Posted January 8, 2009 Thank you all! It finally worked! You guys are awesome! 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