Parsing HTML Data
An HTML document looks something like the following, but usually with a lot more content:
<!doctype html> <html lang="en"> <head> <title>Example Document</title> </head> <body> <p>A man, a plan, a canal. Panama.</p> </body> </html>
HTML structures a document into a tree-like format, as shown in this example by indentation. The <head>
element appears inside the <html>
element. The <title>
element appears inside the <head>
element. An HTML document can have many levels of hierarchy.
Note
Most web browsers provide an option to view a page's source. Select that and you'll see the HTML for the page.
When you run a GET request from a Java application, you need...