in reply to how to browse a dynamic site using mechanize?

Another tool that I have used at times is the testing tool, Selenium, driven by a Perl script.   Basically, the problem is that if the intrinsic behavior of the web site that is being explored is dynamic, the script that explores it must be dynamic also ... and more than that, it must be more-or-less site specific.   If this site contains a magic door, you have to know what the magic word is, and when and how to say it.   Then you must program your (custom...) script to do so, and at this point the lower-level HTTP aware tools are merely the necessary or convenient plumbing.   The task is no longer purely mechanical nor entirely deterministic.

Replies are listed 'Best First'.
Re^2: how to browse a dynamic site using mechanize?
by jack123 (Acolyte) on May 16, 2012 at 07:02 UTC
    #! /usr/bin/perl use strict; use warnings; use WWW::Selenium; my $sel = WWW::Selenium->new( host => "localhost", port => 4444, browser => "*chrome", browser_url => "http://www.google. +com" ); $sel->start(); $sel->open("http://www.google.com"); $sel->click('<button class="gbqfba" name="btnK" aria-label="Google Sea +rch" id="gbqfba"><span id="gbqfsa">Google Search</span></button>'); $sel->wait_for_page_to_load("30000");
    can you tell me how to correct it as I have no clue about the host and the port number

      Why do you paste the documentation? What parts of it do you have problems with?

        Haven't you checked the code it's not complete documentation one, I am confused what to use in host and port and why are they required for browsing the site?