Results 1 to 2 of 2
  1. #1
    FunkyProg is offline Member
    Join Date
    Jan 2011
    Posts
    9
    Rep Power
    0

    Default search within website & retrieve next results page

    Hi guys!

    Here's my problem :

    I want a list of all the DVDs available at my local library. New titles will be added over time, and I don't wanna have to repeat a manual search to have my list updated.

    The URL is Ariane 2.0

    Is it possible to write a Java program that will be able to search the word "dvd", read and process the page source, and then load the next page of results? Actually, I think I can manage with the page source reading and processing, but I'm not sure if the rest is possible.

    Thanks

    Funky
    Last edited by FunkyProg; 03-29-2011 at 08:19 AM.

  2. #2
    FunkyProg is offline Member
    Join Date
    Jan 2011
    Posts
    9
    Rep Power
    0

    Default Frame source

    Okay,

    After a lot of work on my own, I was able to search a term in a website and switch between results pages. But now I'd like to retrieve data in websites that have frames. What I mean is that some websites are made of many frames and each frame has its own page source. The code I am using only retrieves the main page's source, not the frame's source. Here are important lines of my code:

    Java Code:
    String site = "http://ariane2.bibl.ulaval.ca/ariane/?from=jahiahome&requete=dvd&index=TZ&x=0&y=0";
    
    try{
    	URL url = new URL(site);
    	URLConnection connection = url.openConnection();
    	connection.connect();
    	Scanner in = new Scanner(connection.getInputStream());
    
    	while(in.hasNextLine()){	
    
    		line = in.nextLine();
    		if(line.contains("a href") && line.contains("Next Page")){
    				String[]split = line.split("\"");
    				id = split[1];
    									}
    				}
    }
    
    catch(Exception e)
    		{
    		System.out.println(e);
    		}
    
    for(int x = 0; x<500; x++){
    
    site2 = "http://ariane2.bibl.ulaval.ca/ariane/"+id;
    
    	try{
    	
    		URL url = new URL(site2);
    		URLConnection connection = url.openConnection();
    		connection.connect();
    		Scanner in = new Scanner(connection.getInputStream());
    		
    		while(in.hasNextLine()){
    		
    			line = in.nextLine();
    			if(line.contains("a href") && line.contains("Next Page")){
    				String[]split = line.split("\"");
    				id = split[1];
    										}
    					}
    	}
    
    etc...
    Please help me find out how to get the frames' source

    Funky

Similar Threads

  1. Java - Displaying Search Results in jsp using STRUTS
    By selvi in forum Web Frameworks
    Replies: 0
    Last Post: 08-12-2010, 08:48 AM
  2. Design search results .jsp
    By maas in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 07-19-2010, 08:18 AM
  3. How to retrieve information from website using java
    By shahid0627 in forum Networking
    Replies: 4
    Last Post: 07-10-2010, 07:34 PM
  4. Unique Filter on search results
    By selva in forum Lucene
    Replies: 0
    Last Post: 02-17-2009, 08:32 AM
  5. Problem with displaying search results from an array
    By BHCluster in forum New To Java
    Replies: 4
    Last Post: 04-24-2008, 04:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •