Trying to submit a form is resulting in the following error:>> page = agent.submit(f, f.buttons.first)query: "action=start&quick=Y&clientApp=0&clientID=MCO" Net::HTTP::Post: /dealerApply/controller.jsp using cookie: JSESSIONID=GJ4NCvGJDTlrvrKsLw17hZ3FnlXFdVkvB5hh1jLkHKcH4Tn27371!-538794652 request-header: accept-language => en-us,en;q0.5 request-header: connection => keep-alive request-header: accept => */* request-header: accept-encoding => gzip,identity request-header: user-agent => WWW-Mechanize/0.6.8 ( http://rubyforge.org/projects/mechanize/) request-header: content-type => application/x-www-form-urlencoded request-header: cookie => JSESSIONID=GJ4NCvGJDTlrvrKsLw17hZ3FnlXFdVkvB5hh1jLkHKcH4Tn27371!-538794652 request-header: referer => https://censored.com/dealerApply/ request-header: accept-charset => ISO-8859-1,utf-8;q=0.7,*;q=0.7 request-header: content-length => 47 request-header: keep-alive => 300 Errno::EPIPE: Broken pipe from /usr/local/lib/ruby/1.8/openssl/buffering.rb:178:in `syswrite'' from /usr/local/lib/ruby/1.8/openssl/buffering.rb:178:in `do_write'' from /usr/local/lib/ruby/1.8/openssl/buffering.rb:192:in `write'' from /usr/local/lib/ruby/1.8/net/protocol.rb:175:in `write0'' from /usr/local/lib/ruby/1.8/net/protocol.rb:151:in `write'' from /usr/local/lib/ruby/1.8/net/protocol.rb:166:in `writing'' from /usr/local/lib/ruby/1.8/net/protocol.rb:150:in `write'' from /usr/local/lib/ruby/1.8/net/http.rb:1571:in `write_header'' from /usr/local/lib/ruby/1.8/net/http.rb:1536:in `send_request_with_body'' from /usr/local/lib/ruby/1.8/net/http.rb:1522:in `exec'' from /usr/local/lib/ruby/1.8/net/http.rb:1045:in `request'' from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:443:in `fetch_page'' from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:357:in `post_form'' from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:234:in `submit'' from (irb):28 from :0 I''d be happy to provide any other information needed to help debug the problem. Thanks, Michael Guterl -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mechanize-users/attachments/20070523/77d79260/attachment.html
Hello Michael, On Wed, May 23, 2007 at 02:27:32PM -0400, Michael Guterl wrote:> Trying to submit a form is resulting in the following error: > > >>page = agent.submit(f, f.buttons.first) > query: "action=start&quick=Y&clientApp=0&clientID=MCO" > Net::HTTP::Post: /dealerApply/controller.jsp > using cookie: > JSESSIONID=GJ4NCvGJDTlrvrKsLw17hZ3FnlXFdVkvB5hh1jLkHKcH4Tn27371!-538794652 > request-header: accept-language => en-us,en;q0.5 > request-header: connection => keep-alive > request-header: accept => */* > request-header: accept-encoding => gzip,identity > request-header: user-agent => WWW-Mechanize/0.6.8 ( > http://rubyforge.org/projects/mechanize/) > request-header: content-type => application/x-www-form-urlencoded > request-header: cookie => > JSESSIONID=GJ4NCvGJDTlrvrKsLw17hZ3FnlXFdVkvB5hh1jLkHKcH4Tn27371!-538794652 > request-header: referer => https://censored.com/dealerApply/ > request-header: accept-charset => ISO-8859-1,utf-8;q=0.7,*;q=0.7 > request-header: content-length => 47 > request-header: keep-alive => 300 > Errno::EPIPE: Broken pipe > from /usr/local/lib/ruby/1.8/openssl/buffering.rb:178:in `syswrite'' > from /usr/local/lib/ruby/1.8/openssl/buffering.rb:178:in `do_write'' > from /usr/local/lib/ruby/1.8/openssl/buffering.rb:192:in `write'' > from /usr/local/lib/ruby/1.8/net/protocol.rb:175:in `write0'' > from /usr/local/lib/ruby/1.8/net/protocol.rb:151:in `write'' > from /usr/local/lib/ruby/1.8/net/protocol.rb:166:in `writing'' > from /usr/local/lib/ruby/1.8/net/protocol.rb:150:in `write'' > from /usr/local/lib/ruby/1.8/net/http.rb:1571:in `write_header'' > from /usr/local/lib/ruby/1.8/net/http.rb:1536:in > `send_request_with_body'' > from /usr/local/lib/ruby/1.8/net/http.rb:1522:in `exec'' > from /usr/local/lib/ruby/1.8/net/http.rb:1045:in `request'' > from > /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:443:in > `fetch_page'' > from > /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:357:in > `post_form'' > from > /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:234:in > `submit'' > from (irb):28 > from :0 > > I''d be happy to provide any other information needed to help debug the > problem.Can you possibly send a small script that I can run to reproduce the problem? I can''t tell exactly what the issue is from the stack trace. Also, setting the logger on mechanize and sending in the logs would help too. -- Aaron Patterson http://tenderlovemaking.com/
Hello Aaron, On 5/23/07, Aaron Patterson <aaron at tenderlovemaking.com> wrote:> > Hello Michael, > > On Wed, May 23, 2007 at 02:27:32PM -0400, Michael Guterl wrote: > > Trying to submit a form is resulting in the following error: > ><SNIP> > > > > I''d be happy to provide any other information needed to help debug the > > problem. > > Can you possibly send a small script that I can run to reproduce the > problem? I can''t tell exactly what the issue is from the stack trace. > Also, setting the logger on mechanize and sending in the logs would help > too.Here''s the script with censored URL... Let me know if you need anything else. Thanks again for the great library! require ''mechanize'' require ''logger'' agent = WWW::Mechanize.new agent.log = Logger.new(File.new("debug.log", "w+")) page = agent.get("https://censored.com/dealerApply/") form = page.forms.first form.fields.name(''clientID'').options[1].select page = agent.submit(form, form.buttons.first) I, [2007-05-24T09:02:03.617629 #1248] INFO -- : Net::HTTP::Get: /dealerApply/ D, [2007-05-24T09:02:03.812380 #1248] DEBUG -- : request-header: accept-language => en-us,en;q0.5 D, [2007-05-24T09:02:03.812640 #1248] DEBUG -- : request-header: connection => keep-alive D, [2007-05-24T09:02:03.812927 #1248] DEBUG -- : request-header: accept => */* D, [2007-05-24T09:02:03.813076 #1248] DEBUG -- : request-header: accept-encoding => gzip,identity D, [2007-05-24T09:02:03.813224 #1248] DEBUG -- : request-header: user-agent => WWW-Mechanize/0.6.8 (http://rubyforge.org/projects/mechanize/) D, [2007-05-24T09:02:03.813386 #1248] DEBUG -- : request-header: accept-charset => ISO-8859-1,utf-8;q=0.7,*;q=0.7 D, [2007-05-24T09:02:03.813531 #1248] DEBUG -- : request-header: keep-alive => 300 D, [2007-05-24T09:02:03.976138 #1248] DEBUG -- : Read 782 bytes D, [2007-05-24T09:02:03.977916 #1248] DEBUG -- : Read 1806 bytes D, [2007-05-24T09:02:03.979310 #1248] DEBUG -- : Read 2830 bytes D, [2007-05-24T09:02:04.012022 #1248] DEBUG -- : Read 3854 bytes D, [2007-05-24T09:02:04.013683 #1248] DEBUG -- : Read 4072 bytes D, [2007-05-24T09:02:04.015736 #1248] DEBUG -- : Read 5091 bytes D, [2007-05-24T09:02:04.031072 #1248] DEBUG -- : Read 6115 bytes D, [2007-05-24T09:02:04.032569 #1248] DEBUG -- : Read 7139 bytes D, [2007-05-24T09:02:04.033803 #1248] DEBUG -- : Read 8144 bytes D, [2007-05-24T09:02:04.042607 #1248] DEBUG -- : Read 9163 bytes D, [2007-05-24T09:02:04.047887 #1248] DEBUG -- : Read 10187 bytes D, [2007-05-24T09:02:04.049675 #1248] DEBUG -- : Read 11211 bytes D, [2007-05-24T09:02:04.051657 #1248] DEBUG -- : Read 12216 bytes D, [2007-05-24T09:02:04.054323 #1248] DEBUG -- : Read 13235 bytes D, [2007-05-24T09:02:04.060651 #1248] DEBUG -- : Read 14259 bytes D, [2007-05-24T09:02:04.063685 #1248] DEBUG -- : Read 15283 bytes D, [2007-05-24T09:02:04.065266 #1248] DEBUG -- : Read 16288 bytes D, [2007-05-24T09:02:04.067075 #1248] DEBUG -- : Read 17307 bytes D, [2007-05-24T09:02:04.068794 #1248] DEBUG -- : Read 18331 bytes D, [2007-05-24T09:02:04.070233 #1248] DEBUG -- : Read 18580 bytes D, [2007-05-24T09:02:04.080093 #1248] DEBUG -- : response-header: content-type => text/html D, [2007-05-24T09:02:04.080353 #1248] DEBUG -- : response-header: date => Thu, 24 May 2007 13:02:00 GMT D, [2007-05-24T09:02:04.080460 #1248] DEBUG -- : response-header: server => Sun-ONE-Web-Server/6.1 D, [2007-05-24T09:02:04.080546 #1248] DEBUG -- : response-header: set-cookie => JSESSIONID=GVMLvHJPBZpnnGgWtdC4JnDQ7mKd9JvXxHrRYS6qzvwn5J1BKw7g!1550566276; path=/ D, [2007-05-24T09:02:04.080627 #1248] DEBUG -- : response-header: transfer-encoding => chunked D, [2007-05-24T09:02:04.428956 #1248] DEBUG -- : saved cookie: JSESSIONID=GVMLvHJPBZpnnGgWtdC4JnDQ7mKd9JvXxHrRYS6qzvwn5J1BKw7g!1550566276 I, [2007-05-24T09:02:04.429241 #1248] INFO -- : status: 200 D, [2007-05-24T09:03:23.612829 #1248] DEBUG -- : query: "action=start&quick=Y&clientApp=0&clientID=ACE" I, [2007-05-24T09:03:23.613051 #1248] INFO -- : Net::HTTP::Post: /dealerApply/controller.jsp D, [2007-05-24T09:03:23.613420 #1248] DEBUG -- : using cookie: JSESSIONID=GVMLvHJPBZpnnGgWtdC4JnDQ7mKd9JvXxHrRYS6qzvwn5J1BKw7g!1550566276 D, [2007-05-24T09:03:23.613737 #1248] DEBUG -- : request-header: accept-language => en-us,en;q0.5 D, [2007-05-24T09:03:23.613838 #1248] DEBUG -- : request-header: connection => keep-alive D, [2007-05-24T09:03:23.613917 #1248] DEBUG -- : request-header: accept => */* D, [2007-05-24T09:03:23.613993 #1248] DEBUG -- : request-header: accept-encoding => gzip,identity D, [2007-05-24T09:03:23.614070 #1248] DEBUG -- : request-header: user-agent => WWW-Mechanize/0.6.8 (http://rubyforge.org/projects/mechanize/) D, [2007-05-24T09:03:23.614149 #1248] DEBUG -- : request-header: content-type => application/x-www-form-urlencoded D, [2007-05-24T09:03:23.614227 #1248] DEBUG -- : request-header: cookie => JSESSIONID=GVMLvHJPBZpnnGgWtdC4JnDQ7mKd9JvXxHrRYS6qzvwn5J1BKw7g!1550566276 D, [2007-05-24T09:03:23.614304 #1248] DEBUG -- : request-header: referer => https://censored.com/dealerApply/ D, [2007-05-24T09:03:23.614382 #1248] DEBUG -- : request-header: accept-charset => ISO-8859-1,utf-8;q=0.7,*;q=0.7 D, [2007-05-24T09:03:23.615138 #1248] DEBUG -- : request-header: content-length => 45 D, [2007-05-24T09:03:23.615277 #1248] DEBUG -- : request-header: keep-alive => 300 --> Aaron Patterson > http://tenderlovemaking.com/ > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >Thanks, Michael Guterl -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mechanize-users/attachments/20070524/a2e3d6e6/attachment.html
Aaron, On 5/24/07, Michael Guterl <mguterl at gmail.com> wrote:> > Hello Aaron, > > On 5/23/07, Aaron Patterson <aaron at tenderlovemaking.com> wrote: > > > > Hello Michael, > > > > On Wed, May 23, 2007 at 02:27:32PM -0400, Michael Guterl wrote: > > > Trying to submit a form is resulting in the following error: > > ><SNIP> > > > > > > I''d be happy to provide any other information needed to help debug the > > > > > problem. > > > > Can you possibly send a small script that I can run to reproduce the > > problem? I can''t tell exactly what the issue is from the stack trace. > > Also, setting the logger on mechanize and sending in the logs would help > > > > too. > > > Here''s the script with censored URL... Let me know if you need anything > else. > > Thanks again for the great library! > > require ''mechanize'' > require ''logger'' > > agent = WWW::Mechanize.new > agent.log = Logger.new(File.new("debug.log", "w+")) > page = agent.get("https://censored.com/dealerApply/") > form = page.forms.first > form.fields.name(''clientID'').options[1].select > page = agent.submit(form, form.buttons.first) > > I, [2007-05-24T09:02:03.617629 #1248] INFO -- : Net::HTTP::Get: > /dealerApply/ > D, [2007-05-24T09:02: 03.812380 #1248] DEBUG -- : request-header: > accept-language => en-us,en;q0.5 > D, [2007-05-24T09:02:03.812640 #1248] DEBUG -- : request-header: > connection => keep-alive > D, [2007-05-24T09:02:03.812927 #1248] DEBUG -- : request-header: accept => > */* > D, [2007-05-24T09:02:03.813076 #1248] DEBUG -- : request-header: > accept-encoding => gzip,identity > D, [2007-05-24T09:02:03.813224 #1248] DEBUG -- : request-header: > user-agent => WWW-Mechanize/0.6.8 (http://rubyforge.org/projects/mechanize/ > ) > D, [2007-05-24T09:02:03.813386 #1248] DEBUG -- : request-header: > accept-charset => ISO-8859-1,utf-8;q=0.7,*;q=0.7 > D, [2007-05-24T09:02:03.813531 #1248] DEBUG -- : request-header: > keep-alive => 300 > D, [2007-05-24T09:02:03.976138 #1248] DEBUG -- : Read 782 bytes > D, [2007-05-24T09:02:03.977916 #1248] DEBUG -- : Read 1806 bytes > D, [2007-05-24T09:02:03.979310 #1248] DEBUG -- : Read 2830 bytes > D, [2007-05-24T09:02: 04.012022 #1248] DEBUG -- : Read 3854 bytes > D, [2007-05-24T09:02:04.013683 #1248] DEBUG -- : Read 4072 bytes > D, [2007-05-24T09:02:04.015736 #1248] DEBUG -- : Read 5091 bytes > D, [2007-05-24T09:02:04.031072 #1248] DEBUG -- : Read 6115 bytes > D, [2007-05-24T09:02:04.032569 #1248] DEBUG -- : Read 7139 bytes > D, [2007-05-24T09:02:04.033803 #1248] DEBUG -- : Read 8144 bytes > D, [2007-05-24T09:02:04.042607 #1248] DEBUG -- : Read 9163 bytes > D, [2007-05-24T09:02: 04.047887 #1248] DEBUG -- : Read 10187 bytes > D, [2007-05-24T09:02:04.049675 #1248] DEBUG -- : Read 11211 bytes > D, [2007-05-24T09:02:04.051657 #1248] DEBUG -- : Read 12216 bytes > D, [2007-05-24T09:02:04.054323 #1248] DEBUG -- : Read 13235 bytes > D, [2007-05-24T09:02:04.060651 #1248] DEBUG -- : Read 14259 bytes > D, [2007-05-24T09:02:04.063685 #1248] DEBUG -- : Read 15283 bytes > D, [2007-05-24T09:02:04.065266 #1248] DEBUG -- : Read 16288 bytes > D, [2007-05-24T09:02: 04.067075 #1248] DEBUG -- : Read 17307 bytes > D, [2007-05-24T09:02:04.068794 #1248] DEBUG -- : Read 18331 bytes > D, [2007-05-24T09:02:04.070233 #1248] DEBUG -- : Read 18580 bytes > D, [2007-05-24T09:02:04.080093 #1248] DEBUG -- : response-header: > content-type => text/html > D, [2007-05-24T09:02:04.080353 #1248] DEBUG -- : response-header: date => > Thu, 24 May 2007 13:02:00 GMT > D, [2007-05-24T09:02:04.080460 #1248] DEBUG -- : response-header: server > => Sun-ONE-Web-Server/6.1 > D, [2007-05-24T09:02: 04.080546 #1248] DEBUG -- : response-header: > set-cookie => > JSESSIONID=GVMLvHJPBZpnnGgWtdC4JnDQ7mKd9JvXxHrRYS6qzvwn5J1BKw7g!1550566276; > path=/ > D, [2007-05-24T09:02:04.080627 #1248] DEBUG -- : response-header: > transfer-encoding => chunked > D, [2007-05-24T09:02:04.428956 #1248] DEBUG -- : saved cookie: > JSESSIONID=GVMLvHJPBZpnnGgWtdC4JnDQ7mKd9JvXxHrRYS6qzvwn5J1BKw7g!1550566276 > I, [2007-05-24T09:02:04.429241 #1248] INFO -- : status: 200 > D, [2007-05-24T09:03: 23.612829 #1248] DEBUG -- : query: > "action=start&quick=Y&clientApp=0&clientID=ACE" > I, [2007-05-24T09:03:23.613051 #1248] INFO -- : Net::HTTP::Post: > /dealerApply/controller.jsp > D, [2007-05-24T09:03: 23.613420 #1248] DEBUG -- : using cookie: > JSESSIONID=GVMLvHJPBZpnnGgWtdC4JnDQ7mKd9JvXxHrRYS6qzvwn5J1BKw7g!1550566276 > D, [2007-05-24T09:03:23.613737 #1248] DEBUG -- : request-header: > accept-language => en-us,en;q0.5 > D, [2007-05-24T09:03:23.613838 #1248] DEBUG -- : request-header: > connection => keep-alive > D, [2007-05-24T09:03:23.613917 #1248] DEBUG -- : request-header: accept => > */* > D, [2007-05-24T09:03:23.613993 #1248] DEBUG -- : request-header: > accept-encoding => gzip,identity > D, [2007-05-24T09:03:23.614070 #1248] DEBUG -- : request-header: > user-agent => WWW-Mechanize/0.6.8 ( > http://rubyforge.org/projects/mechanize/) > D, [2007-05-24T09:03: 23.614149 #1248] DEBUG -- : request-header: > content-type => application/x-www-form-urlencoded > D, [2007-05-24T09:03:23.614227 #1248] DEBUG -- : request-header: cookie => > JSESSIONID=GVMLvHJPBZpnnGgWtdC4JnDQ7mKd9JvXxHrRYS6qzvwn5J1BKw7g!1550566276 > D, [2007-05-24T09:03:23.614304 #1248] DEBUG -- : request-header: referer > => https://censored.com/dealerApply/ > D, [2007-05-24T09:03:23.614382 #1248] DEBUG -- : request-header: > accept-charset => ISO-8859-1,utf-8;q= 0.7,*;q=0.7 > D, [2007-05-24T09:03:23.615138 #1248] DEBUG -- : request-header: > content-length => 45 > D, [2007-05-24T09:03:23.615277 #1248] DEBUG -- : request-header: > keep-alive => 300 > > > -- > > Aaron Patterson > > http://tenderlovemaking.com/ > > _______________________________________________ > > Mechanize-users mailing list > > Mechanize-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mechanize-users > > > > Thanks, > Michael Guterl > >Do I need to provide you with any more information? Thanks, Michael Guterl -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mechanize-users/attachments/20070529/a8a23346/attachment-0001.html
On Tue, May 29, 2007 at 09:45:19AM -0400, Michael Guterl wrote:> Aaron, >[snip]> > > >agent = WWW::Mechanize.new > >agent.log = Logger.new(File.new("debug.log", "w+")) > >page = agent.get("https://censored.com/dealerApply/") > >form = page.forms.first > >form.fields.name(''clientID'').options[1].select > >page = agent.submit(form, form.buttons.first)[snip]> Do I need to provide you with any more information?Hi Michael, I don''t see anything wrong with your script, and I can''t tell what is causing the problem from the logs. Unfortunately in this case it looks like I would have to actually execute the script. Is there any way you can reproduce the problem using a website where you don''t mind sharing the URL? I would really like to help, but this just seems like one of those times I''ll need a script I can execute. -- Aaron Patterson http://tenderlovemaking.com/