jack123 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on how to browse a dynamic site using mechanize?

Replies are listed 'Best First'.
Re: how to browse a dynamic site using mechanize?
by Corion (Patriarch) on May 15, 2012 at 11:45 UTC

    You asked the same question repeatedly in the chatterbox, and got repeated answers, which you ignored. So I'm repeating the answers for a last time here:

    Have you read what WWW::Mechanize has to say about Javascript support? In what sense is the documentation unclear?

    Have you looked at alternatives to WWW::Mechanize that understand Javascript? Like WWW::Scripter?

Re: how to browse a dynamic site using mechanize?
by Anonymous Monk on May 15, 2012 at 11:46 UTC
Re: how to browse a dynamic site using mechanize?
by locked_user sundialsvc4 (Abbot) on May 15, 2012 at 12:35 UTC

    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.

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