Hi guys, I'm working on a web automation task for my company, accessing an HTTPS site, logging in & navigating through its pages and downloading certain files. I installed the relevant packages, like the WWW::Mechanize, Crypt::SSLeay etc. and was able to fill in forms, navigate & authenticate etc.. However, the problem I'm facing now is in a particular page where I have to fill a form and click on the submit button. A part of the HTML code goes like:
<Br> <Table Width=85% Align=Center border=0 cellspacing=1 cellpadding=1> <Tr> <Td Width=50% Align=Left> &NBSP; </Td> <Td Width=50% Align=Right> <Input Type=Button Name=CmdSearch Value="&NBSP;&NBSP;&NBSP +;Search&NBSP;&NBSP;>>" OnClick="javascript:Search();"> </Td> </Tr> </Table> </Center>
As you may notice, after I fill the form, I'm trying to click on this button named 'CmdSearch' so that it navigates to the next page. Problem though, I presume, is something to do with the "&NBSP". When I apply the script & save the web page on my comp, I can see the filled contents on the text boxes, however it seems like the button hasn't been clicked. This was when I tried the command in the submit_form function : "CmdSearch" => "&NBSP;&NBSP;&NBSP;Search&NBSP;&NBSP;>>" Infact, I removed the   & replaced with blank spaces, tried other combinations too but in vain. Also attempted is the click_button() function using various parameters like name, number , value etc. but again, the script appears to ignore the button in itself. Error messages like button name not found in header etc. display & the script terminates. Anyway, any advice to solve this issue would be, by me, greatly appreciated. Cheers P.S: Pls note that the "&NBSP" was deliberately put in CAPS in this post since the page treats it as a " " when displaying the message.

20070921 Janitored by Corion: Added code tags, as per Writeup Formatting Tips


In reply to Form submission - &NBSP?? by Battle_Fury

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.