import student.web.*; // ------------------------------------------------------------------------- /** * Create a WebBot to traverse the VT web site. * * @author D Barnette barnette@vt.edu * @version 2010.08.25 */ public class VisitVTweb implements WebBotTask { //~ Instance/static variables ............................................. // Change the type of this variable if you write your own custom // robot class. private WebBot bot = null; //~ Methods ............................................................... // ---------------------------------------------------------- /** * Perform a simple traversal of the VT web site home page. */ public void task() { bot = new WebBot("http://www.vt.edu/"); System.out.println( bot.getPageURL().toString() ); System.out.println( "----------" ); //System.out.println( bot.getCurrentElementText() ); //System.out.println( "----------" ); System.out.println( bot.getPageTitle() ); System.out.println( "----------" ); bot.returnToStartOfPage(); //System.out.println( bot.getCurrentElementText() ); } // ---------------------------------------------------------- /** * This method provides access to the robot that carries out this * task. Change the return type of this method if you write * your own custom robot class. * @return The robot used by this task. */ public WebBot getRobot() { return bot; } }