a2515125 wrote:
hey,
I have trouble of extracting the certain word inside the id
I only can extract "rc.u_0_24" by my code but I want to extract "u_0_24" Only
how can I get rid of "rc." because they are packed as one....Orz
it is sad that we can not use * to replace variable inside" " in event mode
i think there are three ways to achieve it but dont know how to use regular expression correctly
1. extract u_0_24 from "rc.u_0_24"
2. replace "rc.u_0_24" as "rc\\.u_0_24"
3. clean "rc."
need a help at this part.....Orzzz
imacro 8.9.1/windows10/FF50.1
Code: Select all
SET !EXTRACT NULL
TAG POS=1 TYPE=DIV ATTR=CLASS:_1cx1<SP>_4qr4<SP>_4aay<SP>_4ab3<SP>_2qma EXTRACT=HTM
SET !VAR2 EVAL ("var s='{{!EXTRACT}}'; var z=s.split('\"'); z[11];")
'PROMPT {{!EXTRACT}}
PROMPT {{!VAR2}}
Hum..., pretty sure FCI was not mentioned when I had checked the Thread after you had started it, it's always a bit "dangerous" to silently edit your Post later to add some missing Info, chances are I won't notice it, FCI is the first thing I check to decide if I read or not..., and you may post it a bit more "visible" at the complete beginning of your Post like I do in my Quote, rather than lost "somewhere" in the middle of your Post... (then I would already have replied 2 days earlier...)
But OK... hum, v8.9.1 is no Standard Version, you can better use v8.9.7 I would think..., which works on your FF50... and still until at least FF v55.0.3, which is the FCI I use myself...)
But, yep, to isolate your String, yep, 'split()' is the way, but you need a Double 'split()', for before and after your String, but that should be a 'piece of cake" if you understand a bit how 'split()' works, and I've already posted dozens of Examples on the Forum...
You can use more than 1 Char in the 'split()'... => Try using a longer String than only your '\"' on the Double Quote which forces you to keep the 12th Result for the 1st 'split()', stg that will be a bit more unique than only one single Double Quote...
Hum, and your Thread Title could use a "?", you are not sharing a 'HowTo'...! (One more Reason why I didn't reply then...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...