I want to write a program in java that it can parse search engine results and save URLs and titles in a file, but I don't know how can I do this?
Extract URLs from search engine results
Collapse
X
-
Comment
-
Here's a quick example from Sun's website:
It's pretty easy to find with google.Code:public static void main(String[] args) throws Exception { URL url = new URL("http://www.google.com/"); URLConnection urlc = url .openConnection(); BufferedReader in = new BufferedReader( new InputStreamReader( urlc.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) System.out.println(inputLine); in.close(); }
Try modifying it to meet your needs, and come back if you have a problem.Comment
Comment