All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class web.SimpleUserAgent

java.lang.Object
   |
   +----web.SimpleUserAgent

public class SimpleUserAgent
extends Object
A user agent that can fetch pages from web servers. As the prefix 'Simple' implies it is very easy to use.

See Also:
WebPage

Constructor Index

 o SimpleUserAgent(String)
Construct agent with agent name.

Method Index

 o retrievePage(String)
Fetch the page with the given URL.

Constructors

 o SimpleUserAgent
 public SimpleUserAgent(String name)
Construct agent with agent name. The agent name is transmitted as "User-Agent" to all servers this class instance ever connects to.

Parameters:
name - agent name

Methods

 o retrievePage
 public WebPage retrievePage(String url) throws IOException
Fetch the page with the given URL.

Parameters:
url - the URL.
Returns:
instance of WebPage containing the fetched page.
Throws: IOException
if the page could not be retrieved for some reason.

All Packages  Class Hierarchy  This Package  Previous  Next  Index