azbob wrote:Sorry my Bad. I'm unfamiliar with the use /syntax of extract=HTM
I thought it was more complicated then just replacing TXT with HTM.
So this works:
Code: Select all
TAG POS=2 TYPE=TD ATTR=CLASS:ReportManagerTable_rows EXTRACT=HTM
PROMPT _{{!EXTRACT}}_
SET Name EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.split('<br>'); y=x[0].split('>'); z=y[1].trim(); y;")
SET Address EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.split('<br>'); y=x[1].split('<img'); z=y[0].trim(); z;")
PROMPT Name:<SP>_{{Name}}_<BR>Address:<SP>_{{Address}}
!EXTRACT:
Code: Select all
_<td class="ReportManagerTable_rows" style="outline: 1px solid blue;"> JOHN R GRAY II
4965 E Red Range Way CAVE CREEK,AZ 85331<img src="/images/spacer1.gif" width="1" height="1" border="0"> </td>_
NAME:
Code: Select all
Name: _<td class="ReportManagerTable_rows" style="outline: 1px solid blue;", JOHN R GRAY II_
Address: _4965 E Red Range Way CAVE CREEK,AZ 85331_
Code: Select all
Address: _4965 E Red Range Way CAVE CREEK,AZ 85331_
I'll mess with the NAME to get it pure, but no biggie cause I only need address.
Thanks.
Now back to my, "Function Expected" error when I tried to reverse() address any ideas??
wanted to get: 85331,AZ,CAVE CREEK, Way Range Red E 4965
Code: Select all
SET Rev_addr EVAL("var x,y,z; x = '{{Sub_split_NME_NBR}}'; z = x.reverse(); z;")
Error -1250: JScript statement in EVAL contains the following error: Function expected. Line 23: SET Rev_addr EVAL("var x,y,z; x = '{{Sub_split_NME_NBR}}'; z = x.reverse(); z;")
Hum, strange on the Name, you seem to be "hitting" the same what I called "mini-Difficulty" on what I thought was the '<BR>' for Backward Splitting but maybe simply concerns the '>'..., then I guess this one will work for you... (I cannot test...):
Code: Select all
TAG POS=2 TYPE=TD ATTR=CLASS:ReportManagerTable_rows EXTRACT=HTM
PROMPT _{{!EXTRACT}}_
SET Name1 EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.split('<br>'); y=x[0].split('>'); z=y[1].trim(); z;")
SET Name2 EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.split('>'); y=x[1].split('<'); z=y[0].trim(); z;")
SET Address EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.split('<br>'); y=x[1].split('<img'); z=y[0].trim(); z;")
PROMPT Name1:<SP>_{{Name1}}_<BR>Name2:<SP>_{{Name2}}_<BR>Address:<SP>_{{Address}}
I would expect 'Name2' to be OK...?
EDIT: But no, my Script was correct I think, you modified it with 'y'/'z', you need to return 'y[1]' like I did if you don't want to use 'z'...
=> And not only 'y', which is still an Array...!! (And contains 2 Elements..., separated indeed by a Comma...)
>>>
About your 'reverse()' Function, pfffff..., dunno, from what I can follow from your Code, you were taking a String, split into an Array, until there OK, but then split the Array (no idea what that gives, ah-ah...!), keeping one Item from that "Result", to split it again, arrrggghhh...!, and trying to apply your 'reverse()' Command which is meant to be applied on Arrays, but you were already at an Array of the 2nd or 3rd "Dimension", ah-ah...!
azbob wrote:Well hold on a minute, is there an easier way to split address into it's 4 components of
House address, city, state and zip from the back to front??
Well, yep, split on Space I would think (on "my"...! Result which is a String, then 'split()' will give you an Array, ah-ah...!) and you can then use your 'reverse()' Function, but you might need to use some "sub" 'join()' for the Street for example, based on the Length of the Array...
>>>
OK, I saw you updated your 2 Threads on SOF, perfect... And yep indeed, for the 'Dynamic Frame' Thread, you linked directly to a post where I had asked you indeed to mention your FCI in that SOF-Thread, and to share your Sol..., ah-ah...! Never too late thus, ah-ah...! (FCI still not mentioned in that Thread, but OK, don't worry, everything is good enough, you really did your best, ah-ah...! Sorry, I can be a pain in the ass, I know...!
)
- (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...