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
-
SimpleUserAgent(String)
- Construct agent with agent name.
-
retrievePage(String)
- Fetch the page with the given URL.
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
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