search for: responsecodeerror

Displaying 11 results from an estimated 11 matches for "responsecodeerror".

2012 Feb 16
3
Mechanize::ResponseCodeError: 500
...n > system. The url is https://secure.mdausa.org/donate/ > It works in my browser however using mechanize following error appears: > > /Library/Ruby/Gems/1.8/gems/mechanize-2.0.1/lib/mechanize/http/agent.rb:241:in > `fetch'': 500 => Net::HTTPInternalServerError (Mechanize::ResponseCodeError) > from /Library/Ruby/Gems/1.8/gems/mechanize-2.0.1/lib/mechanize.rb:628:in > `post_form'' > from /Library/Ruby/Gems/1.8/gems/mechanize-2.0.1/lib/mechanize.rb:520:in > `submit'' > from > /Library/Ruby/Gems/1.8/gems/mechanize-2.0.1/lib/mechanize/form.rb:167:in >...
2010 Oct 20
2
Mechanize::ResponseCodeError: 500
...er: server => Apache/2.2.8 (Fedora) response-header: date => Wed, 20 Oct 2010 19:21:53 GMT response-header: content-length => 72 response-header: cache-control => no-store, no-cache, must-revalidate, post-check=0, pre-check=0 response-header: pragma => no-cache status: 500 Mechanize::ResponseCodeError: 500 => Net::HTTPInternalServerError from /Library/Ruby/Gems/1.8/gems/mechanize-1.0.0/lib/mechanize.rb:259:in `get'' from (irb):26 Could you realize what is wrong? p.s. I also changed agent type. -------------- next part -------------- An HTML attachment was scrubbed... URL: &lt...
2007 Oct 05
3
basic_auth problem since 0.6.9
...2.2.12 mod_ssl/2.8.10 OpenSSL/0.9.6e D, [2007-10-05T12:46:45.350311 #4958] DEBUG -- : response-header: content-length => 1510 D, [2007-10-05T12:46:45.350369 #4958] DEBUG -- : response-header: tcn => choice, choice I, [2007-10-05T12:46:45.362057 #4958] INFO -- : status: 500 WWW::Mechanize::ResponseCodeError: 500 => Net::HTTPInternalServerError from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.10/lib/mechanize.rb:185:in `get'' from (irb):11 Thanks, Gary
2012 Aug 02
2
Handling HTTP 500 errors
Hey guys, How do you handle HTTP 500 errors with Mechanize? After researching the web I thought something like this would work: begin Mechanize.new.get(url_which_returns_500) rescue Net::HTTPInternalServerError puts "Life is awesome. Let''s move on" end Anyways, the code in the rescue block will never be executed. Can you guys help me out? Kenny
2006 Sep 26
7
Interesting mechanize difficulty
I found an interesting page today that I was trying to script against. The server returns a 404 with content and the page just works normally in firefox despite the 404. Mechanize raises an exception on it though. I''m working on a test case now.
2007 Feb 07
15
https with certificates
I poked around the web a little and didn''t run across how to use https when it asks for certificate validation. I''m trying to connect to devices that don''t have valid certificates, and in this case, I don''t care if they are or not. So when I use my browser to ge to the site, firefox asks me to allow the certificate, then one other question, then I get the
2006 Nov 07
5
mechanize: 400 Bad Request
Hello, when trying to access a certain HTML-frame, I get: "in `request'': Unhandled response (WWW::Mechanize::ResponseCodeError)" and the page returns: "400 Bad Request" * Why? * How to solve this? With browser, it works. In the logs below, I marked 4 lines with "***", where I see possible differences in the URI. But I don''t know, if this is the reason for the malfuncion and how to...
2006 Dec 31
0
Retrying requests
I use this method to retry my requests if there are retrieval problems. def with_retries(num_retries = 4) begin yield rescue Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EHOSTUNREACH, Errno::ECONNREFUSED, Errno::ETIMEDOUT, Timeout::Error, WWW::Mechanize::ResponseCodeError num_retries -= 1 retry unless num_retries < 0 raise end end So I can try three times to get a page: with_retries(2){page.click()} before the outer method raises an exception. But I''m not really sure if I''m catching all the right exceptions. Anyone know?...
2006 Sep 18
2
BUG: Possible issue with escaped hrefs
...gent.get(''http://localhost/~schapht/link_test/start.html'') second = agent.click(first.links.first) puts second.body --- end test.rb Expected: This page is after the link. Actual: /opt/local/lib/ruby/1.8/net/http.rb:1049:in `request'': Unhandled response (WWW::Mechanize::ResponseCodeError) [likely due to 404] Finally, I''m attaching a CSV of Charles'' output to this email. Hopefully it''ll work on the list. -Mat -------------- next part -------------- A non-text attachment was scrubbed... Name: link_debug.csv Type: application/octet-stream Size: 507 b...
2009 Sep 05
0
getting an url encoded uri
...cool algorithms with mechanize and I came across this weird situation. I am trying to get this uri "http://www.relax.si/kratke po?itnice.aspx" like this (with url encoded uri): agent.get("http://relax.si/kratke%20po%u010Ditnice.aspx") and in return I get: WWW::Mechanize::ResponseCodeError: 400 => Net::HTTPBadRequest from /Library/Ruby/Gems/1.8/gems/mechanize-0.9.3/lib/www/mechanize.rb: 238:in `get'' The same url encoded uri works ok in browser. How does mechanize handle url encoded uri? How can I make this work? Thanks very much, Mihael
2007 Jul 12
3
Basic_auth questions
How do you make get the page when using basic_auth? Below is code, I am getting a 401 error. I am not sure if the basic _auth comes before the agent.get. I will appreciate any help. require ''mechanize'' require ''logger'' agent = WWW::Mechanize.new {|a| a.log = Logger.new(STDERR) } page = agent.get(''https://brewx.qualcomm.com/developer'' )