import java.net.*;
import java.util.*;
import java.io.*;

public class URLGet{
	public static void main(String[] argv)throws Exception
	{
		URL yahoo = new URL("http://maps.google.it/maps?f=q&hl=it&geocode=&q=milano+ristoranti&ie=UTF8&ll=44.320164,8.456039&spn=0.056617,0.154495&z=13");
		//URL yahoo = new URL("file:/home/xraver/Codici/java/URLGet/index.html");
		URLConnection yo = yahoo.openConnection();
		Scanner sc = new Scanner(yo.getInputStream());
		String input;
		StringTokenizer st;
		String s;
		while(sc.hasNext())
		{
			input = sc.nextLine();
			if(input.contains("laddr"))
			{
				st = new StringTokenizer(input, "\"");
				boolean found=false;
				while(st.hasMoreTokens())
				{
					s = st.nextToken();
					if(found)
					{
						System.out.println(s);
						break;
					}
					if(s.contains("laddr"))
						found=true;
				}
			}
		}

		//PrintStream pippow = new PrintStream(new File("pippo.txt"));
		//pippow.println("babbo");
		//Scanner pippor = new Scanner(new File("pippo.txt"));
		//System.out.println(pippor.nextLine());
	}
}
