Java Reference
In-Depth Information
As you can see from the above list, there are three USA cities, which you may choose to
find the time. To find the time for each city you would have to click on the link and view that
city's page. This would be a total of four pages to access - first the city list page, and then a
page for each of the three cities. For exact information on how to run this recipe refer to Ap-
pendix B, C, or D, depending on the operating system you are using.
This recipe will access the city list page, obtain the URL for each city, and then obtain the
time for that city. Now, let's examine Listing 3.4 - the HTML that makes up the city list page.
Listing 3.4: The HTML for the Cities List
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>HTTP Recipes</TITLE>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<meta http-equiv="Cache-Control" content="no-cache">
</HEAD>
<BODY>
<table border="0"><tr><td>
<a href="http://www.httprecipes.com/">
<img src="/images/logo.gif" alt="Heaton Research Logo" bor-
der="0"></a>
</td><td valign="top">Heaton Research, Inc.<br>
HTTP Recipes Test Site
</td></tr>
</table>
<hr><p><small>[<a href="/">Home</a>:<a href="/1/">First Edition
</a>:
<a href="/1/3/">Chaper 3</a>]</small></p>
<p>Select a city from the list below, and you will be
shown the local time for that city.<br>
<ul>
<li><a href="city.php?city=2">Baltimore, MD</a>
<li><a href="city.php?city=3">New York, NY</a>
<li><a href="city.php?city=1">St. Louis, MO</a></ul>
<hr>
<p>Copyright 2006 by <a href="http://www.heatonresearch.com/">
Heaton Research, Inc.</a></p>
</BODY>
</HTML>
Search WWH ::




Custom Search