-2

I have a webapp hosted in a webpage, I access the page using url,this page has a text box and start button.can i pass a value in the text box and click the start button automatically by using Perl script.

I have used WWW::Mechanize module. I am able to get data from webpage but not able to set to anything back on the page. I am not able to achieve the click functionality also.

RobEarl
  • 7,862
  • 6
  • 35
  • 50

1 Answers1

0

This sounds to me like you are trying to fill out a form in a web page. This is possible by fetching the forms of the page via the forms method and then use the resulting HTML::Form objects.

If you already know, exactly what the form values will be named, you can also use the submit_form(with_fields => {…}) method to send the form directly without iterating through the forms of the web page. An example of how to do that is found in the synopsis of the WWW::Mechanize documentation.

If you need JavaScript, see the WWW::Mechanize FAQ, section JavaScript: Which modules work like Mechanize and have JavaScript support?

daxim
  • 39,270
  • 4
  • 65
  • 132
tauli
  • 1,420
  • 8
  • 13
  • 2
    [`WWW:Selenium`](https://metacpan.org/module/WWW::Selenium), [`WWW::Mechanize::Firefox`](https://metacpan.org/module/WWW::Mechanize::Firefox) – Zaid Aug 14 '12 at 08:55