i have created a program that will read the source from a website and then do other things. however i cannot get my program to read from the website that i want to work with. all it returns is null, over and over.
here is the part of code that i guess reads from the website.
when i change the url to:Code:if(buttonObj == searchButton) { try { String name = nameField.getText(); URL url = new URL("http://www.kingsofchaos.com/battlefield.php?jump=&search_type=s&search=" + name); URLConnection connection = url.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); // this isnt in my actual program but is just to show the output for(int i = 0; i < 20; i++) { line = in.readLine(); System.out.println(line); } } catch(Exception e) { System.out.print(e); } }
i get the actual source code which is what i want.Code:URL url = new URL("http://www.yahoo.com");


Reply With Quote


Bookmarks