Regency Posted October 15, 2008 Posted October 15, 2008 i have my prog pull up a page but i need it to pull a string from inside a sentance. like.. SUCCESS: answer_result="saloonsPrince" I need to pull out SaloonsPrince with out the " " anyone have any idea, i thought about using the html body read, but then cant figure out how to only read the "" stuff.. anyone got ideas?
PsaltyDS Posted October 15, 2008 Posted October 15, 2008 i have my prog pull up a page but i need it to pull a string from inside a sentance. like..SUCCESS: answer_result="saloonsPrince"I need to pull out SaloonsPrincewith out the " "anyone have any idea, i thought about using the html body read, but then cant figure out how to only read the "" stuff..anyone got ideas?Read it all into a string, then pull out what you want with StringRegExp(), or using other string manipulation functions like StringInStr() and StringMid(). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Regency Posted October 15, 2008 Author Posted October 15, 2008 (edited) $read = _IEBodyReadText($Test) $string = _StringBetween($read,""",""","") MsgBox('','',$string) this was my idea... but i keep getting zeor, as it saying the data isnt processing.. anyone got any ideas on why? EDIT: It wont always be saloonsprince it changes in time, i just need it to read between the " " maybe thats better explination? Edited October 15, 2008 by Regency
PsaltyDS Posted October 15, 2008 Posted October 15, 2008 $read = _IEBodyReadText($Test) $string = _StringBetween($read,""",""","") MsgBox('','',$string) this was my idea... but i keep getting zeor, as it saying the data isnt processing.. anyone got any ideas on why? EDIT: It wont always be saloonsprince it changes in time, i just need it to read between the " " maybe thats better explination? You specified text between "," and NUL. Perhaps you meant _StringBetween($read, '"', '"'). Note the double quotes are enclosed in single quotes. You can specify a literal double quote by doubling it up inside the outer quotes, but that results in four double quotes in a row, like this: _StringBetween($read, """", """"). Just looking for anything between double quotes is pretty broad, and you are likely to get more hits than you want. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Regency Posted October 15, 2008 Author Posted October 15, 2008 Well, actually the thing i posted before is from the source and is the only thing on the page. which what you told me to do only made my text empty,as i would think that means it getting nothing when looking inbetween the "". Correct?
PsaltyDS Posted October 15, 2008 Posted October 15, 2008 Well, actually the thing i posted before is from the source and is the only thing on the page. which what you told me to do only made my text empty,as i would think that means it getting nothing when looking inbetween the "". Correct? I think you missed that _StringBetween() returns an array. Your result is in $string[0]. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Regency Posted October 15, 2008 Author Posted October 15, 2008 I aint gunna lie, i am so lost.. i cant make this work even with the addition of the [0] it now throws a error
Regency Posted October 15, 2008 Author Posted October 15, 2008 (edited) #include<ie.au3> #Include <String.au3> Global $string[0] $Test = _IECreate("",0,1,1,0) _ieloadwait($test) $read = _IEBodyReadText($Test) $string[0] = _StringBetween($read,'"','"') MsgBox('','',$string[0])oÝ÷ ÚØZ¶Ì!jØ ¢Öî¶+dyêmº0xzºè¬@ÈM«¢+Ø¥¹±Õ±Ðí¥¹ÔÌÐì(%¹±Õ±ÐíMÑÉ¥¹¹ÔÌÐì((ÀÌØíQÍÐô}% ÉÑ ÅÕ½ÐìÅÕ½Ðì°À°Ä°Ä°À¤)}¥±½Ý¥Ð ÀÌØíÑÍФ(ÀÌØíÉô}% ½åIQáÐ ÀÌØíQÍФ(ÀÌØíÍÑÉ¥¹ô}MÑÉ¥¹ Ñݸ ÀÌØíɰÌäìÅÕ½ÐìÌäì°ÌäìÅÕ½ÐìÌäì¤)5Í ½à ÌäìÌäì°ÌäìÌäì°ÀÌØíÍÑÉ¥¹lÁt¤ fixed it, my nub mistake thanks for the help Edited October 15, 2008 by Regency
dbzfanatic Posted October 15, 2008 Posted October 15, 2008 #include<ie.au3> #Include <String.au3> Global $string $Test = _IECreate("",0,1,1,0) _ieloadwait($test) $read = _IEBodyReadText($Test) $string = _StringBetween($read,'"','"') MsgBox('','',$string[0]) You're misunderstanding how an array works. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
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