in reply to Re: how to browse a dynamic site using mechanize?
in thread how to browse a dynamic site using mechanize?

#! /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

Replies are listed 'Best First'.
Re^3: how to browse a dynamic site using mechanize?
by Corion (Patriarch) on May 16, 2012 at 07:19 UTC

    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?

        Have you read WWW::Selenium? Especially the first paragraph of the "DESCRIPTION" section, which happens to be the first paragraph of prose in the documentation? Also, the last sentence of that section could help you understand more. I'm quoting both here:

        Selenium Remote Control (SRC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser. SRC provides a Selenium Server, which can automatically start/stop/control any supported browser. It works by using Selenium Core, a pure-HTML+JS library that performs automated tasks in JavaScript; the Selenium Server communicates directly with the browser using AJAX (XmlHttpRequest).

        http://www.openqa.org/selenium-rc/

        ...

        To use this module, you need to have already downloaded and started the Selenium Server. (The Selenium Server is a Java application.)