in reply to Re^2: In a Web Page forms are displayed as empty
in thread In a Web Page forms are displayed as empty

Hi jesuashok,

I had a hunch that the pages in question are generated by JavaScript using 'document.write', so I /msg'd you to confirm this. I have seen some pages that use document.write to output html. Let us take for a basic example the following html page:
<html> <head> <title>Bad Example</title> </head> <body> <script> document.write('<H1>JavaScript made me do it!</H1>') </script> </body> </html>
Now the following Perl code:
#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new; $mech->get('http://yourserverhere/test.html'); print $mech->content( format => "text" );
Which outputs: "Bad Example". Why? Because "Please note that Mech does NOT support JavaScript. Please check the FAQ in WWW::Mechanize::FAQ for more.".

You can use Win32::IE::Mechanize or Mozilla::Mechanize or alike to control a browser which does know how to deal with JavaScript. This is another reason to always refer to the documentation.

Update: Excuse the lack of error checking in the Perl script above, I wanted to get this post to you ASAP and I have to attend a project meeting.

Hope this helps

Martin