Charles Harvey
2008-Feb-29 20:40 UTC
[Mechanize-users] problems getting back full data from post to https://www.sss.gov/RegVer/wfVerification.aspx
Why can''t I get back the same full page as I do in firefox after a post? I am trying to post data to https://www.sss.gov/RegVer/wfVerification.aspx It is accepting the post, for both a valid record and a not found record, but the html code I am getting back in mechanize is not complete as the code I am getting back in firefox view source. In firefox the page works without javascript. I read through the forum and tried google, but could not find answer. Any help would be greatly appreciated. Best Regards- Charles pastie version of the same here http://pastie.caboo.se/private/0qsxcjzwunvijds0quuonq require ''rubygems'' require ''mechanize'' agent = WWW::Mechanize.new agent.user_agent_alias = ''Mac FireFox'' agent.redirect_ok = true page = agent.get(''https://www.sss.gov/RegVer/wfVerification.aspx'') sss_form = page.form(''aspnetForm'') sss_form.[]=("_ctl0:ContentPlaceHolder1:tbSSAN", 555555999) sss_form.[]=("_ctl0:ContentPlaceHolder1:tbLastName", "Harvey") sss_form.[]=("_ctl0:ContentPlaceHolder1:tbDOB", "03251966") page = agent.submit(sss_form, sss_form.buttons[1]) ###{#################################################################}# If I do it with my real data I get a line in the returned code that says it was a success >> sss_form.[]=("_ctl0:ContentPlaceHolder1:tbSSAN", 510999999) => 510565972 >> sss_form.[]=("_ctl0:ContentPlaceHolder1:tbLastName", "Smith") => "Harvey" >> sss_form.[]=("_ctl0:ContentPlaceHolder1:tbDOB", "02021966") => "02051966" >> page = agent.submit(sss_form, sss_form.buttons[1]) => #<WWW::Mechanize::Page {url #<URI::HTTPS:0x90d292 URL:https://www.sss.gov/RegVer/wfVerification.aspx>}{meta} {title "\r\n\tSelective Service System: Verification Receipt\r\n"} {iframes} ########################################## If I submit it with a fake name and SS# I get a field as accepting the post but returning as expected a no record found message. >> page = agent.submit(sss_form, sss_form.buttons[1]) => #<WWW::Mechanize::Page {url #<URI::HTTPS:0x909944 URL: https://www.sss.gov/RegVer/wfError.aspx?Message=NotFound_V&src=VER>} {meta} {title "\r\n\tSelective Service System: Registration Error\r\n"} But with either one I do not get back the same information in my firefox browser source namely: ******* From page source in firefox on a successful post - edited ********** <font face="Arial" size="2"><b>Last Name:</b> <span id="_ctl0_ContentPlaceHolder1_lblLastName" class="registrationcopy_light" style="font-style:italic;">Harvey</span></font> <br /> <font face="Arial" size="2"><b>Social Security Number:</b> <span id="_ctl0_ContentPlaceHolder1_lblSSAN" class="registrationcopy_light" style="font-style:italic;">*** - ** - 5999</span></font> <br /> <font face="Arial" size="2"><b>Date of Birth:</b> <span id="_ctl0_ContentPlaceHolder1_lblDOB" class="registrationcopy_light" style="font-style:italic;">03/25/1966</span></font> <br /> <font face="Arial" size="2"><b>Selective Service Number:</b><br /> <span id="_ctl0_ContentPlaceHolder1_lblSSN" style="font-style:normal;">66-0175555-2</span><br /> <font face="Arial" size="2"><b>Date of Registration<br /> </b> <span id="_ctl0_ContentPlaceHolder1_lblAccessionDate" style="font-style:normal;">4/9/1984</span></font></p> ********************************************************************************************************* ******* From page source in firefox on a post that does not have a valid record- edited ********** <font face="Arial" size="2"> <span id="_ctl0_ContentPlaceHolder1_lblErrorTitle" class="validation2">Sorry. </span> <br /> <span id="_ctl0_ContentPlaceHolder1_lblErrorDetail" class="registrationcopy_light">Based on the information you submitted (information listed below), a registration record cannot be found for this individual.</span> <span id="_ctl0_ContentPlaceHolder1_lblErrorDetail2" class="registrationcopy_light"><br><br>If you made a mistake when entering data, please try a </span> <span id="_ctl0_ContentPlaceHolder1_lblErrorDetail3" class="registrationcopy_light"></span> <a id="_ctl0_ContentPlaceHolder1_lnkError1" class="registrationcopy_light" href="wfVerification.aspx">New Search</a> <span id="_ctl0_ContentPlaceHolder1_lblErrorDetail4" class="registrationcopy_light"></span> <a id="_ctl0_ContentPlaceHolder1_lnkError2" class="registrationcopy_light"></a> <span id="_ctl0_ContentPlaceHolder1_lblErrorDetail5" class="registrationcopy_light">. If you entered the data correctly, there are several reasons why the registration may not be verifiable at this time. Please dial 1-847-688-3117 for further information.</span> <span id="_ctl0_ContentPlaceHolder1_lblTimeStamp" class="timestamp">(2/29/2008 11:09:16 AM)</span><em></em></font></td> <span id="_ctl0_ContentPlaceHolder1_lblLastName" class="registrationcopy"><br><br>Last Name: </span> <span id="_ctl0_ContentPlaceHolder1_lblLastName2" class="registrationcopy_light">Smith<br></span><br /> <span id="_ctl0_ContentPlaceHolder1_lblSSAN" class="registrationcopy">Social Security Number: </span> <span id="_ctl0_ContentPlaceHolder1_lblSSAN2" class="registrationcopy_light">*** - ** - 5999<br></span> <span id="_ctl0_ContentPlaceHolder1_lblSSN3" class="registrationcopy"></span> <span id="_ctl0_ContentPlaceHolder1_lblSSN4" class="registrationcopy_light"></span><br /> <span id="_ctl0_ContentPlaceHolder1_lblDOB" class="registrationcopy">Date of Birth: </span> <span id="_ctl0_ContentPlaceHolder1_lblDOB2" class="registrationcopy_light">03/25/1966<br></span><br /> <span id="_ctl0_ContentPlaceHolder1_lblErrorDetail6" class="registrationcopy_light"></span> <a id="_ctl0_ContentPlaceHolder1_lnkError3" class="registrationcopy_light"></a> pastie version of the same here http://pastie.caboo.se/private/0qsxcjzwunvijds0quuonq -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mechanize-users/attachments/20080229/cd7a4283/attachment-0001.html