Hey peeps,
I want to simply compile this program but i keep getting the error message: java.lang.ArrayIndexOutOfBoundsException
Any help? :)
import java.util.ArrayList;
import org.htmlparser.util.*;
import org.htmlparser.*;
import org.htmlparser.tags.*;
import org.htmlparser.filters.*;
public class you {
static String s;
static ArrayList <String> filter(String s,ArrayList <String> m)
{
ArrayList <String> m1= new ArrayList<String>();
for(int i=0;i<m.size();i++){
String c=m.get(i);
m1.add(c);
}
return m1;
}
public static void main (String [] args) throws ParserException{
Parser parser = new Parser (args[0]);
NodeList list = parser.parse (new LinkStringFilter(""));
ArrayList <String>m= new ArrayList<String>();
for (int i=0;i<list.size();i++)
{
m.add(i,((LinkTag)(list.elementAt(i))).extractLink());
}
String s="http://"+args[0];
m=filter(s,m);
for(String si :m){
System.out.println(si);
}
}
}
Btw in order to compile this - u guys need to put a htmlparser.jar into ur classpath !
just in case - this code don't compile for u !