Yes, we love to have anyone helping anyone here. HTML, JS, JQuery, PHP, just about anything programming!
It just helps a lot of it is placed under the correct heading so the people interested in one language more
than others can look at their preferred language first. Seems to work well so far…
Everyone has their own favorite IDE and libraries for their programming. Glad you can help Harish as I am a
bit weak in Java. I have scraped Google search with PHP and found it easy to pull out the URL’s. I have a
work in progress that takes the URL’s, scraps the actual pages and pulls all the info from them. Using this for
a self searching knowledge system. Works, but, slowly at the moment…
As far as his question…
Harish, you can check a URL to see if it exists, but, it gets tricky as you need to check for 404, 400, 403, etc
responses to see what the server sends you back. Another way that I found for you is to attempt to get
the “header” back from it instead. If you get a header, then the URL exists, if not it is a no-go. Some code
to do this would be something like:
[php]
url = new URL(“http://www.example.com”);
HttpURLConnection huc = (HttpURLConnection) url.openConnection();
int responseCode = huc.setRequestMethod(“HEAD”);
if (responseCode) {
System.out.println(“GOOD”);
} else {
System.out.println(“BAD”);
}
[/php]
This is not tested, just the basic code for you to try… (I do little with Java, but, found this online for you.)