azbob wrote:Well Thanks to you I got it working,I wish there was a more 'solid' delimiter between house address and city than double spaces, but I'll take it.
Code: Select all
TAG POS=2 TYPE=TD ATTR=CLASS:ReportManagerTable_rows EXTRACT=HTM
'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;")
SET House EVAL("var s='{{Address}}'; var x,y,z; x=s.split(' '); x[0];")
SET Zip EVAL("var s='{{Address}}'; var x,y,z; x=s.split(','); y=x[1].split(' '); y[1];")
SET City EVAL("var s='{{Address}}'; x=s.split(' '); y=x[1].split(','); y[0];")
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_<BR>Name2:<SP>_{{Name2}}_<BR>Address:<SP>_{{Address}}_<BR>House:<SP>_{{House}}_<BR>City:<SP>_{{City}}_<BR>zip:<SP>_{{Zip}}_
PROMPT Results:
Code: Select all
EXTRACT: _<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>_
Name2: _JOHN R GRAY II_
Address: _4965 E Red Range Way CAVE CREEK,AZ 85331_
House: _4965 E Red Range Way_
City: _ CAVE CREEK_
zip: _85331_
BTW: I noticed that when i did this results came back "undefined".
Code: Select all
SET House EVAL("var x,y,z; s='{{Address}}'; x=s.split(' '); x[0];")
Yet this syntax works:
Code: Select all
SET House EVAL("var s='{{Address}}'; var x,y,z; x=s.split(' '); x[0];")
What is the explanation for that??
Again thanks for all your help!
Good-good-good...! Much simpler than your original "cumbersome" 'EVAL()' Statements, you see...
"I wish there was a more 'solid' delimiter between house address and city than double spaces..."
=> Well, don't complain, you have 3 Spaces in a row, more "unpredictable" maybe in some cases would be if there was only 1 Space...
Well, about the "__undefined__" for 'House', hum, dunno, both Statements return the same (correct) Result for me (on v8.8.2 for FF), and both with 2 or 3 Spaces in the 'split()'...
I notice you have a Double Space in the first Statement, before the "x=...", maybe iMB is sensitive for those...
Stg interesting I noticed is that you indeed don't even need the "var x,y,z;" Declaration like you removed/forgot(...?) in 'City', and you even don't need the "var " part each time if the Var you want to declare/use is defined with a "=", so this one works as well:
Code: Select all
SET City EVAL("s='{{Address}}'; x=s.split(' '); y=x[1].split(','); y[0];")
=> ... which would allow you to simplify further all your Statements...
I had already noticed it some time ago, but I never really checked "correctly"..., and that's interesting for myself as well, as I often use 'EVAL()' Statements where I reuse quite a few previous Vars + usually a few Temp "x,y,z" Vars, that will shorten my own 'EVAL()' Statements each time by about 20 Chars, ah-ah...!
- (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...