I need help with a java program to query
and display everything between the first occurrence of the tags
<title> and </title>
Things like <whatever> are called HTML tags. The </title> ends the tag <title>.
If a webpage contains
<title>Sophie, Sally and Jack</title>
your program should print
Sophie, Sally and Jack
If no <title> ... </title> tags appear, print a message such as "No <title> was found in http://pravda.ru."
You may assume that if <title> and </title> occur, they occur in the same line of the file.
Your program should handle any thrown exceptions with an informative message.
sectetur adipiscing elit. Nam
sectetur adipiscing elit. Nam lac
sectetur adipiscing elit. Nam lacinia pulvinar tortor nec
sectetur adipiscing elit. Nam lacinia
sectetur adipiscing elit.
sectetur adipiscing elit. Nam l
Unlock access to this and over
10,000 step-by-step explanations
Have an account? Log In