It would involve a more complicated filter that would run slower.
I guess it could find the link tags as above, and then look for sibling table columns in the table row that match a div pattern.
See the FilterBuilder application rather than trying to code it yourself.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How to parse this page...
I want the addresses displayed below the map.
http://clients.mapquest.com/kfc/mqlocator?screen=map&searchtype=origin&link=map&&event=pan&height=250&iconid=31&level=4892937&ml=4892937&mqdbplace0=1.552550,388875,-993177,KFCE865002,Kentucky%20Fried%20Chicken,2804%20NORTH%20VINE%20STREET,,,Hays,KS,US,67601,%28913%29625-3711,,98511,Y,N,N,N,,,,,,,UNK,86,,56,86,FRN,,N,N,N,,E865002,,N,Y,N&mqdbplace1=2092.090820,383617,-987784,KFCE865003,Kentucky%20Fried%20Chicken,2917%20W.%20TENTH,,,Great%20Bend,KS,US,67530,%28316%29793-8226,,98511,Y,N,N,N,,,,,,,UNK,55,1,27,55,FRN,,N,N,N,,E865003,,N,Y,N&mqdbplace2=7414.747070,377537,-1000303,KFCE865004,Kentucky%20Fried%20Chicken,1210%20WEST%20WYATT%20EARP%20BLVD.,,,Dodge%20City,KS,US,67801,%28316%29225-1241,,98511,Y,N,N,N,,,,,,,UNK,80,1,38,80,FRN,,N,N,N,,E865004,,N,Y,N&mqdbplace3=8147.925781,376462,-987393,KFCC975014,Kentucky%20Fried%20Chicken,100%20N.%20MAIN,,,Pratt,KS,US,67124,%28316%29672-5393,,98511,Y,N,N,N,,,,,,,UNK,28,1,14,28,FRN,,N,N,N,,C975014,,N,,N&mqdbplace4=8355.551758,388327,-976252,KFCG145007,Kentucky%20Fried%20Chicken,430%20S.%20Broadway,,,Salina,KS,US,67401,%28913%29825-0322,,98511,N,N,N,N,,,,,,,UNK,84,,61,84,FRN,,N,N,N,,D451006,,N,Y,N&mqdbplace5=8877.092773,380572,-979178,KFCC975001,Kentucky%20Fried%20Chicken,703%20E.%20FOURTH%20STREET,,,Hutchinson,KS,US,67501,%28316%29663-5232,,98511,Y,N,N,N,,,,,,,UNK,76,1,35,76,FRN,,N,N,N,,D451001,,N,Y,N&mqdbplace6=9451.383789,383699,-976347,KFCE865001,Kentucky%20Fried%20Chicken,2118%20E.%20KANSAS,,,McPherson,KS,US,67460,%28620%29241-1762,,98511,Y,N,N,N,,,,,,,UNK,88,1,54,88,FRN,KL,N,N,N,,E865001,,N,,N&mqdbplace7=10315.686523,395605,-976576,KFCC975024,Kentucky%20Fried%20Chicken,1707%20Lincoln%20Street,,,Concordia,KS,US,66901,%28785%29243-1535,,98511,N,N,N,N,,,,,,,K90,,1,0,0,FRN,,N,N,N,,D451007,,N,,N&mqdbplace8=10526.770508,379774,-1008439,KFCE865006,Kentucky%20Fried%20Chicken,2208%20E.%20KANSAS%20AVENUE,,,Garden%20City,KS,US,67846,%28316%29276-7868,,98511,Y,N,N,N,,,,,,,UNK,120,1,32,120,FRN,,N,N,N,,E865006,,N,Y,N&mqdbplace9=13642.325195,402067,-1006470,KFCE450001,Kentucky%20Fried%20Chicken,811%20North%20Highway%2083,,,Mccook,NE,US,69001,%28308%29345-4150,,98511,Y,Y,N,Y,,CO,,OL,,,KTPx70,54,1,102,54,FRN,KPT,N,N,N,,018818,,N,,N&orig_lat=388698&orig_lng=-993220&orig_name=67601&querycenterorigin=1&queryiconid=20060&querymax=10&queryradius=999&queryuseorigin=1&search.x=0&search.y=0&searchtype=origin&si=31&smap=map&so=1&sqlcmb1=or&sqlcnd1=%3d&sqlcnd2=contains&sqlcol1=name&sqlcol2=multibrand&sqlval1=Kentucky%20Fried%20Chicken&sqlval2=K&ss=1&width=380&zip=67601&lat=388697&lng=-993218&ml=4892937&event=pan&&MQDbPlace0=1.552550,388875,-993177,KFCE865002,Kentucky%20Fried%20Chicken,2804%20NORTH%20VINE%20STREET,,,Hays,KS,US,67601,%28913%29625-3711,,98511,Y,N,N,N,,,,,,,UNK,86,,56,86,FRN,,N,N,N,,E865002,,N,Y,N&MQDbPlace1=2092.090820,383617,-987784,KFCE865003,Kentucky%20Fried%20Chicken,2917%20W.%20TENTH,,,Great%20Bend,KS,US,67530,%28316%29793-8226,,98511,Y,N,N,N,,,,,,,UNK,55,1,27,55,FRN,,N,N,N,,E865003,,N,Y,N&MQDbPlace2=7414.747070,377537,-1000303,KFCE865004,Kentucky%20Fried%20Chicken,1210%20WEST%20WYATT%20EARP%20BLVD.,,,Dodge%20City,KS,US,67801,%28316%29225-1241,,98511,Y,N,N,N,,,,,,,UNK,80,1,38,80,FRN,,N,N,N,,E865004,,N,Y,N&MQDbPlace3=8147.925781,376462,-987393,KFCC975014,Kentucky%20Fried%20Chicken,100%20N.%20MAIN,,,Pratt,KS,US,67124,%28316%29672-5393,,98511,Y,N,N,N,,,,,,,UNK,28,1,14,28,FRN,,N,N,N,,C975014,,N,,N&MQDbPlace4=8355.551758,388327,-976252,KFCG145007,Kentucky%20Fried%20Chicken,430%20S.%20Broadway,,,Salina,KS,US,67401,%28913%29825-0322,,98511,N,N,N,N,,,,,,,UNK,84,,61,84,FRN,,N,N,N,,D451006,,N,Y,N&MQDbPlace5=8877.092773,380572,-979178,KFCC975001,Kentucky%20Fried%20Chicken,703%20E.%20FOURTH%20STREET,,,Hutchinson,KS,US,67501,%28316%29663-5232,,98511,Y,N,N,N,,,,,,,UNK,76,1,35,76,FRN,,N,N,N,,D451001,,N,Y,N&MQDbPlace6=9451.383789,383699,-976347,KFCE865001,Kentucky%20Fried%20Chicken,2118%20E.%20KANSAS,,,McPherson,KS,US,67460,%28620%29241-1762,,98511,Y,N,N,N,,,,,,,UNK,88,1,54,88,FRN,KL,N,N,N,,E865001,,N,,N&MQDbPlace7=10315.686523,395605,-976576,KFCC975024,Kentucky%20Fried%20Chicken,1707%20Lincoln%20Street,,,Concordia,KS,US,66901,%28785%29243-1535,,98511,N,N,N,N,,,,,,,K90,,1,0,0,FRN,,N,N,N,,D451007,,N,,N&MQDbPlace8=10526.770508,379774,-1008439,KFCE865006,Kentucky%20Fried%20Chicken,2208%20E.%20KANSAS%20AVENUE,,,Garden%20City,KS,US,67846,%28316%29276-7868,,98511,Y,N,N,N,,,,,,,UNK,120,1,32,120,FRN,,N,N,N,,E865006,,N,Y,N&MQDbPlace9=13642.325195,402067,-1006470,KFCE450001,Kentucky%20Fried%20Chicken,811%20North%20Highway%2083,,,Mccook,NE,US,69001,%28308%29345-4150,,98511,Y,Y,N,Y,,CO,,OL,,,KTPx70,54,1,102,54,FRN,KPT,N,N,N,,018818,,N,,N&queryIconId=20060
Thanks in advance
-Jeff
It might be easier to go after the "Drive It" URL and parse the url for the info.
This filter picks up link tags that have a class="yellow" attribute.
import org.htmlparser.*;
import org.htmlparser.filters.*;
import org.htmlparser.beans.*;
import org.htmlparser.util.*;
public class Derrick
{
public static void main (String args[])
{
NodeClassFilter filter0 = new NodeClassFilter ();
try { filter0.setMatchClass (Class.forName ("org.htmlparser.tags.LinkTag")); } catch (ClassNotFoundException cnfe) { cnfe.printStackTrace (); }
HasAttributeFilter filter1 = new HasAttributeFilter ();
filter1.setAttributeName ("class");
filter1.setAttributeValue ("yellow");
NodeFilter[] array0 = new NodeFilter[2];
array0[0] = filter0;
array0[1] = filter1;
AndFilter filter2 = new AndFilter ();
filter2.setPredicates (array0);
NodeFilter[] array1 = new NodeFilter[1];
array1[0] = filter2;
FilterBean bean = new FilterBean ();
bean.setFilters (array1);
if (0 != args.length)
{
bean.setURL (args[0]);
System.out.println (bean.getNodes ().toHtml ());
}
else
System.out.println ("Usage: java -classpath .;htmlparser.jar;htmllexer.jar Derrick <url>");
}
}
Thanks you saved my time... I'm interested to see how the code would be if we want the locations unlike parsing the hyperlink(like above code)
It would involve a more complicated filter that would run slower.
I guess it could find the link tags as above, and then look for sibling table columns in the table row that match a div pattern.
See the FilterBuilder application rather than trying to code it yourself.