Displaying 20 results from an estimated 30000 matches similar to: "Testing?"
2012 Feb 16
3
Mechanize::ResponseCodeError: 500
> Excuse me if my issue is a little bit application-specific. I need
> Mechanize to submit bunch of data from our server to an online reservation
> 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'':
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
2007 May 20
1
Tips on testing
Hey WWW::Mechanize users,
I''ve been using Mechanize for about 3 or 4 months now, and I''m rather
enjoying it. I''ve done scraping in PHP & Python, starting with raw text and
HTTP requests, moving up to regex and Curl, and finally landed myself here,
making me much more productive when scraping pages.
At the moment, I''m in the middle of a decent sized
2011 Jan 18
2
how to get captcha image with mechanize ?
Hey, how to get captcha image with mechanize ? the image is not a
static picture, it''s a stream, a text-model.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20110118/bf9a58ff/attachment.html>
2012 Apr 30
3
way to get response headers only?
Hello, I''m interested in grabbing the final uri of a given uri after any
redirects without retrieving the response body of this final uri. For
example, if uri1 redirects to uri2, which in turn redirects to uri3, I''d
like to just grab the response header of uri3.
I know that I can get the full response (header and body) by doing
Mechanize.new.get(uri1).uri, but again,
2009 May 08
2
Malformed HTML
I''m using Mechanize to parse an extraordinarily malformed html page.
After submitting a form like so:
page = mech.submit(dform)
The result I get back is truncated. I suspect that it''s because the
source HTML looks like this:
<html>
<head> yadda yadda</head>
<p>some text</p>
<html>
<table yadda yadda>
My
2008 Jul 17
3
Convert data to utf-8
Hello, I''m trying to find a solution to convert everything returned by
mechanize to utf-8, no matter if the original page is utf-8 or iso and I
really don''t know where to start from...
agent = WWW::Mechanize.new { |a| a.log =
Logger.new(File::join(RAILS_ROOT, "log/mechanize.log")) }
one_page = agent.get("www.google.fr")
My first problem is that one_page
2010 Jun 10
2
submit button param is duplicated when a form is submitted a second time
Hello,
Below I''ve pasted a simple example to reproduce what I say in the
subject. I wonder...
Is it a bug? Is there any workaround?
Thanks!
require ''rubygems''
require ''mechanize''
agent = Mechanize.new
page = agent.get(''http://google.com/'')
google_form = page.form(''f'')
google_form.q = ''ruby
2007 Sep 30
3
Problems with Forms
Hi,
I am using mechanize for a while now. Works great. But at the moment I
have a small problem using it.
The problematic file is attached. In that PHP-File you will see a
formular, but mechanize doesn''t recognize it.
Could somebody check this?
Thanks,
Bodo
--
http://www.tvbrowser.org
http://www.wannawork.de
-------------- next part --------------
An HTML attachment was scrubbed...
2010 Jun 03
3
issue submitting a form
Hi. Recently I started rebuilding my old Mechanize script, which I
used to automatically log in to a certain site and retrieve files from
it. Old version worked great, however, when I did the update it
started complaining. Here''s the log of the error:
/Users/lukastolyarov/.gem/ruby/1.8/gems/mechanize-1.0.0/lib/mechanize/form/field.rb:30:in
`<=>'': undefined method
2009 Apr 09
1
undefined method ''text'' ...
Just trying to run the example
*****
require ''rubygems''
require ''mechanize''
a = WWW::Mechanize.new
a.get(''http://rubyforge.org/'') do |page|
# Click the login link
login_page = a.click(page.links.text(/Log In/))
# Submit the login form
my_page = login_page.form_with(:action => ''/account/login.php'')
2006 Oct 17
6
form submit debugging
version 0.62
I''ve got a form that''s giving me trouble (server reports invalid session
ID). Unfortunately, the form is submitted using SSL so I can''t use a
sniffer to see the differences between the ruby mechanize version and
the perl mechanize version that is working. Is there a way to change the
form action within mechanize? Or a way to display the request headers?
2010 Oct 20
2
Mechanize::ResponseCodeError: 500
Also, excuse me if my issue is a little bit application-specific. I need
Mechanize to submit bunch of data from our server to an online reservation
system. The url ishttp://hajres.iranair.com/haj/request.php"
It works in my browser however, using mechanize following error appears:
>> agent.get("http://hajres.iranair.com/haj/request.php")
Net::HTTP::Get: /haj/request.php
2012 Sep 22
2
Mechanize and Thread-Safety Revisited
This post from Aaron Patterson back in 2009 seems to be pretty definite about how to use Mechanize in a thread-safe way, but I thought I would revisit the question because there are several posts on StackOverflow since then that would seem to contradict it (of course, I trust Aaron''s answer more than random answers on StackOverlfow, but just in case I thought I would confirm it).
It is
2007 Jul 15
3
rejected form not handled
Hello,
I have a login form on /login.php which POSTs to /dorf1.php when access is
granted and to /login.php when it is denied.
require ''rubygems''
require ''mechanize''
agent = WWW:Mechanize.new()
login = agent.get("http://server/login.php")
form = login.forms.action("dorf1.php")
form.fields[2].value = "wronguser" # login
2007 Mar 25
5
mechanize 0.6.6 Released
mechanize version 0.6.6 has been released!
http://mechanize.rubyforge.org/
The Mechanize library is used for automating interaction with websites.
Mechanize automatically stores and sends cookies, follows redirects,
can follow links, and submit forms. Form fields can be populated and
submitted. Mechanize also keeps track of the sites that you have visited as
a history.
Changes:
=
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'' )
2009 Jun 25
2
Bad Form?
Hi,
This is my first post, I wanted to ask a quick question about "Bad Form" --
rather, am I doing something with Mechanise I shouldn''t be doing?
Here''s the long and short of it - I am using Mechanize with Cucumber and
RSpec to test a *ahem* Perl XML web service.. talk about technology soup,
but I have it working quite well.
I have an example project on GitHub that
2007 Sep 20
4
issues submitting a search form
Hello to the list and thanks to Aaron for the cool software.
I''ve been fooling around with Mechanize and Hpricot for a couple of
days and from the docs I''ve read, the following code SHOULD work but
doesn''t. I''ve tried the same code on a couple of different sites and I
get the same exception for each. Any pointers or suggestions are
appreciated.
2007 Jul 24
3
Jruby + Rhino = Javascript support?
Hey Aaron, I''m just thinking out loud here, but have you considered
the possibility of using the Rhino [1] library to implement
javascript support in mechanize? It''d create a jruby dependency for
that feature, but still. Just thought I''d bring it up while I was
thinking about it.
-Mat
[1] http://www.mozilla.org/rhino/