lets say i have a list of urls such as
http://stackexchange.com
https://stackoverflow.com/users/login
http://careers.stackoverflow.com
http://chat.stackoverflow.com
http://meta.stackoverflow.com
https://stackoverflow.com/about
this list is in a text file.
now i would like to process all the urls in one go. The below coding is the processor.
String sourceUrlString="http://stackexchange.com";
if (args.length==0)
System.err.println("Using default argument of \""+sourceUrlString+'"');
else
sourceUrlString=args[0];
if (sourceUrlString.indexOf(':')==-1) sourceUrlString="file:"+sourceUrlString;
Source source=new Source(new URL(sourceUrlString));
String renderedText=source.getRenderer().toString();
System.out.println("\nSimple rendering of the HTML document:\n");
System.out.println(renderedText);
as you see, the coding above only can process one url at one time where i must manually key in the url at the sourceurlstring. How do i process all of the urls in the text file in one go ?
1 Answer