Re: [Htmlparser-user] Script Tag question
Brought to you by:
derrickoswald
From: Srinivas V. <vip...@ho...> - 2007-07-02 18:24:23
|
Ok...I think I have figure this one. I just had to set the STRICT variable = in the ScriptScanner class to false. By default it is true. Cheers,=0A= Srinivas.From: vip...@ho...To: htm...@li...urceforge.= netDate: Sun, 1 Jul 2007 20:52:59 -0400Subject: [Htmlparser-user] Script Ta= g question=0A= =0A= =0A= =0A= =0A= =0A= Hello, I am having trouble getting the complete script code for some sc= ript tags. I get the correct source for all script tags except this one. If= I alter the script slightly, it does give me the complete script code. Her= e is what I am doing: try{ Parser parser =3D new Parser("http= ://www.autos.yahoo.com"); NodeList list =3D parser.parse (null); = NodeFilter filter =3D new MyNodeFilter(); // I have a filter to just = give me script nodes NodeList nl =3D list.extractAllNodesThatMatch(= filter,true); int len =3D nl.size(); for (int i =3D 0; i < = len; i++) { ScriptTag n =3D (ScriptTag)nl.elementAt(i);= System.out.println("Counter at "+i+n.getScriptCode()); = } }For some reason, I dont get the full scr= iptcode for one particular node. I only get a certain portion of it. Below = is the original script code and for some reason it breaks at the penultimat= e line(shown below). Any Ideas??//function getMakes(myArray, selected_make)= function getMakes(myArray, selected_make_id) { var arrayLength =3D myArray= .length; //var regex =3D new RegExp("[\' .-]","g"); //alert("selected_mak= e_id:" + selected_make_id); for (var i=3D0;i<arrayLength;i++) { var mkS= plitArray =3D myArray[i][0].split(":"); var makeName =3D mkSplitArray[0= ]; var makeValue =3D mkSplitArray[1]; var selected =3D ""; // if (m= akeName.replace(regex,"").toLowerCase() =3D=3D selected_make.replace(regex,= "").toLowerCase()) { if (selected_make_id =3D=3D makeValue) { sel= ected =3D " selected"; } document.write('<option' + selected + ' valu= e=3D"' + makeValue + '">' + makeName + "</option>\n"); } // for i ----= --> If i remove this it works fine.}Cheers,=0A= Srinivas.Make every IM count. Download Windows Live Messenger and join the = i=92m Initiative now. It=92s free. Make it count!=0A= _________________________________________________________________ Play free games, earn tickets, get cool prizes! Join Live Search Club.=A0 http://club.live.com/home.aspx?icid=3DCLUB_wlmailtextlink= |