HTML Parser

Create an Eclipse project named HTMLParser that includes a class named HTMLParser. Delete any starter code that Eclipse provides and replace it with the code below. Modify the code so that the program allows a user to input a web page address and then displays the title of that web page. The title of a web page is found between its <title> and </title> HTML tags. As you test your program, you may need to view the underlying source code of several web pages. To view the HTML source code of a web page, you can typically right-click a web page in any browser and click "View Source". The title of a web page is what shows up in a browser windows title bar or the entry that appears in a list of bookmarks or favorites. See the instructor if you are confused about the source code and HTML <title> tags of a web page.

Preconditions:
The user-inputted web page address will be valid and the web page found at that address will have a title. The title tags will either be all lowercase (<title> and </title>) or all uppercase (<TITLE> and </TITLE>)

Your program must follow the class Coding Standards. You will lose points if there are style violations in your code. Call the instructor to your computer to have him grade the source code and the run-time execution.

Take a screen capture of your program's output and upload it to your Google site so others can see it as an example of what you've accomplished in Java.

/**
 * HTMLParser
 * @author John Doe Per 1
 */

import java.io.IOException;
import java.net.URL;
import java.util.Scanner;

public class HTMLParser
{
  
   public static void main (String [] args) throws IOException
   {
      // variable declarations
      String htmlCode = "";                                   // HTML code of web page	  
      String webPageAddress = "http://www.wyoarea.org";       // user inputed web page address
      String title = "";

      // prompt the user to input a web page address & get that address from the user
      Scanner keyboard = new Scanner(System.in);
      System.out.print("Enter a full web page address (URL) and  press the Enter key: ");
      webPageAddress = keyboard.nextLine();

      // retrieve HTML code from web page - backslash Z marks the end of a file
      htmlCode = new Scanner(new URL(webPageAddress).openStream()).useDelimiter("\\Z").next();
      	  
      // write a call statement that calls the getTitle method below and 
      // assigns the String that it returns to the variable title 



 


      // display the title of the web page




  }// end of main method
  
  // precondition: htmlCode contains some text between its <title> and </title> tags 
  //               which will either be lowercase or uppercase (but not mixed).
  // postcondition: returns the text that is between the <title> and </title> tags
  public static String getTitle(String htmlCode)
  {










      return ""; // temporary

  }// end of getTitle method
  
}// end of HTMLParser class