Displaying 20 results from an estimated 900 matches similar to: "BUG: Possible issue with escaped hrefs"
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.
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'':
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
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
2008 Mar 11
8
Mechanize#get vs Mechanize#fetch_page
So I found myself wanting to call Mechanize#get with a hash for
arguments like this:
WWW::Mechanize.new(''http://api.flickr.com/services/rest/'', {:method =>
''flickr.auth.getFrob''... })
Granted, it looks like this isn''t supported but it led me to what
looks like a bug. Namely that get calls fetch_page(abs_uri, request,
cur_page, &block)
2007 Oct 05
3
basic_auth problem since 0.6.9
I have a site that I don''t think "returns" a basic_auth request, but is
able to use basic_auth.
In the past on 0.6.8, I could use the following code:
require ''rubygems''
# gem ''mechanize'', ''=0.6.8''
require ''mechanize''
agent = WWW::Mechanize.new
agent.basic_auth("username", "password")
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
2007 Jul 02
6
Basic auth bug in 0.6.9
I haven''t spent the time to get a proper test case for this yet, but
there appears to be a bug in the basic_auth code for mechanize
0.6.9. I''ve attached a CSV (from Charles) that illustrates the problem.
Basically when running with basic_auth, there''s a failed request
that''s followed up by a successful request. That last POST is a
agent.submit(form)
2007 Jan 27
7
Getting elements from a web page
I am new to Mechanize and was wondering if there was a built-in method
to get the elements that are on the page that are not part of a form.
A couple of examples would be my banking site lists my entries and I
want them to go into an array so that I can handle them.
Or another site I use, does some categorization for me and I would like
to manipulate it and present it differently to a user.
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
2006 Nov 02
5
Adding fields to a form
Is there a decent way to add a field to a form before posting it? I
haven''t tried using HPricot manipulations just yet, since I can''t
ever find really solid docs on hpricot....
Form#[]= doesn''t work because it first searches only pre-existing
fields. I''m investigating how to write a patch now.
But I thought maybe someone here might have an idea.
2008 Mar 15
4
[PATCH] Get requests with non-html referers
Hey, Aaron. Looks like that get with hash params patch you checked in
had some side effects. Specifically, you''re testing if a referer is a
Page (mechanize.rb:171), but the referer could also be a
WWW::Mechanize::File. Like if the last page loaded was xml. Here''s a
patch that addresses the issue.
Thanks again,
Mat
-------------- next part --------------
A non-text
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/
2009 May 05
3
Only partially reading a page!
I am trying to get a page which includes a form, but the form is
missing from the WWW::Mechanize::Page object. I retrieve it via:
page = web_agent.submit(a_different_form)
For debugging this problem, I then immediately write the resulting
page to two different logs:
File.open(''big.html'',''wb'') { |f| f.write(page.body) }
2008 Mar 10
2
Mechanize for multi-part form post
Hi,
I''m interested in using Mechanize as a way around manual multipart
form creation. But the API is really centered around the idea of a
form built from a page. I''d love to see a syntax like:
response = agent.post(''http://www.mydomain.com/upload'',
:image => File.new(file),
:title => "My image",
:description => "an image
2008 Apr 29
6
Intercepting an onClick file download
Hi,
I''m having some trouble downloading a .csv file from a particular
website. The file isn''t part of a url, you need to click on a link in
order to get the file sent. I don''t know how to get mechanize to
correctly identify that.
Here is the link to the file I''m trying to retrieve:
<td style="vertical-align: bottom; text-align: center;">
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 Jun 29
0
(no subject)
Thanks Mat.
----- Original Message ----
From: Mat Schaffer <schapht at gmail.com>
To: Ruby Mechanize Users List <mechanize-users at rubyforge.org>
Sent: Friday, June 29, 2007 7:22:40 AM
Subject: Re: [Mechanize-users] (no subject)
On Jun 26, 2007, at 11:33 AM, Matt White wrote:
Hello,
I am on a page that lists 78 items and can only show 25 per page, so there are links for each
2009 Sep 05
0
getting an url encoded uri
Hello,
I am assembling my first 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
2007 Dec 20
0
Relative URL fix
Hi Facebookers,
I have been working on a change to facebooker to allow facebook and
non-facebook apps to exist on the same code-base. I modified the url
rewriting in facebooker a bit so that it would continue to use the
facebook relative url when needed but not prepend the facebook app
name to controller paths that didn''t have anything to do with your
facebook app.
Here is the