First you can find appropriate link. Identify an element and get attribute href.
Then:
We can use HttpURLConnection Class and getResponseCode method for finding the reponse code of the URL.
public static int getResponseCode(String urlString) throws MalformedURLException, IOException {
URL u = new URL(urlString);
HttpURLConnection huc = (HttpURLConnection) u.openConnection();
huc.setRequestMethod("GET");
huc.connect();
return huc.getResponseCode();
}