Displaying 20 results from an estimated 3000 matches similar to: "Adding fields to a 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.
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) }
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 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)
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 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 Dec 10
3
Road to 0.7.0
Hey everyone,
I''ve been refactoring Mechanize for an 0.7.0 release. Basically I''m
trying to clean the code up and there are a few features that I think
are unnecessary, but I would like to ask people first.
1) REXML as a parser.
I want to remove support for REXML. I don''t use it. Hpricot seems to
do everything I need.
2) 1.8.2 thru 1.8.4 support
2006 Dec 07
6
Response To Form Submission Hanging
Hello,
I am using Mechanize to post a form to a website. When I do this by
hand in my browser the response takes about 35s to come back (it''s a
long page full of tables and graphics). When I do this with
Mechanize, the server starts to respond and then appears to hang.
The obvious conclusion is that my code is wrong but I am reasonably
sure that I haven''t altered it
2007 Jul 23
3
dependencies
I knew that hpricot was a dependency, but hoe and rubyforge....is this right?
Version 0.6.9 for ruby
Mike B.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
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/
2008 Jan 16
3
settings headers in mechanize
hi,
a potential mechanize user here. i''ve looked at the API but it''s not
clear what capacity there is to arbitrarily set the headers - does
mechanize allow for this?
mechanize is clearly great for web browsing, but i also need to
construct get and post requests from scratch. i''ve looked at
net:http, libcurl, openuri, but mechanize seems simpler and more
functional than
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:
=
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 Jan 12
1
Single method call to retrieve the entire page in HTML?
All,
Another easy question. In Hpricot, on a doc that I am using, I can do a
.to_html method and retrieve the entire page. However, this doesn''t seem to
work in Mechanize.
My goal is to the text of the page and put it into a database to make it
searchable with ferret (using the acts_as_ferret plugin in Rails). Does
anyone have a good suggestion short of iterating over the entire
2006 Sep 18
2
BUG: Possible issue with escaped hrefs
I noticed an interesting problem today when scripting against a web
app. The application contained a link in it that used %20 instead of
spaces. After running mechanize through the Charles debugging proxy
I found that mechanize was converting %20 to %2520 (double escaping
the %20).
This appears to happen under both 0.5.4 and 0.6.0.
Here''s a simple set of files that demonstrate
2007 Jul 23
2
What does {bogusetag </TABLE>} mean?
I got this in one of my pages, and I''m not exactly sure what it means.
ideas?
Mike B.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
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
2007 May 28
2
Clicking image maps?
Hello all,
I am trying to click image maps ("area" nodes), and while Perl''s
mechanize treats "a", "area", "frame", "iframe" and "meta" tags as
links, it seems to me that Ruby''s Mechanize thinks only "a" tags can be
links (at least my little experiment, namely:
page.links.each {|link| puts link.node.name}
2008 Jul 10
1
custom http headers in form.submit / upload without original form
Heyas :)
I''m wondering how do I do to send my custom HTTP headers when posting
a form. agent.set_headers is a private method and I don''t know how to
get a reference to HTTPHeaders to use add_field and such.
Since my request is a form, I''m sending it using agent.submit(form). Any hints?
Bonus question: I would like to upload a file to a REST webservice,
but I
2008 Jan 15
1
Converting Watir script to Mechanize
I have a Watir script that I would like to convert to a Mechanize
script. The watir code looks like this
require ''watir''
include Watir
def test
ie = IE.new
ie.goto(''http://cpref.gsm.com/inter.asp?r=8084'')
ie.text_field(:name, ''inter_string'').set(''Potassium'')
ie.button(:id, ''image1'').click