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

Dear Friends,

Can you suggest to get all controls and providing user data to the controls (Text box, combo box, link, buttons, etc..) in an web page without viewing the source code of the web page.

What all are the best packages available and how can i install those packages?

Best Regards,
Anbarasu
  • Comment on What could be the best way to capture controls in a web page?

Replies are listed 'Best First'.
Re: What could be the best way to capture controls in a web page?
by targetsmart (Curate) on Feb 13, 2009 at 06:55 UTC
    If your requirement is to test your web application, a non-perl solution would be http://webtest.canoo.com/webtest/manual/WebTestHome.html
    LWP may help you to construct robots.

    Vivek
    -- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.
Re: What could be the best way to capture controls in a web page?
by CountZero (Bishop) on Feb 13, 2009 at 16:27 UTC
    WWW::Mechanize and its brethren should be a good place to start looking. It does not render the webpage, if that is what you mean by "viewing" but of course it will have to download the source of the web-page. It then parses this source code and extracts all links and forms and allows you to access these.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: What could be the best way to capture controls in a web page?
by lostjimmy (Chaplain) on Feb 13, 2009 at 16:23 UTC