similar to: Mechanize and Thread-Safety Revisited

Displaying 20 results from an estimated 2000 matches similar to: "Mechanize and Thread-Safety Revisited"

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 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 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
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.
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 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
2007 Feb 26
1
some Mechanize objects never garbage collected?
Greetings, I''m using Mechanize to scrap dozens of pages and have noticed the size of my ruby process keeps growing. I set Mechanize.max_history to 0 with no effect on the memory use. I wrote a little test to show the objects left on the heap after mechanizing a single page and then doing a garbage collection. Sample list appended below. I can supply the test code if it helps.
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 12
1
WWW::Mechanize::Link.inspect needs some TLC
The problem: users trying to debug Mechanize apps with Komodo are finding the debugger times out once it''s loaded a web page. They don''t run into this in the ruby-debug debugger, or running in normal mode. The reason: Komodo''s debugger is graphical, which means that whenever it hits a breakpoint it automatically shows the contents of each local variable. It has a
2006 Oct 11
2
Mechanize: save and cancel doesn''t work in JSPWiki
I''m trying to submit data in JSPWiki (edit page). I can read the data in the form, but nothings get saved when I submit the page. Cancel doesn''t work either. I don''t get any errors. There is no JavaScript used to submit the form. After I''m logged in I do the following: def save(page, content) @agent.get(@base_url + "Edit.jsp?page=#{page}")
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?
2007 Jan 04
5
Help accessing http headers?
Hi, I''m using Mechanize, and I''ve developed a lot of code around it. I''d like to be able to check the Etag header during a get to see if the page has changed, as well as some other http header information. Can I do that without hacking Mechanize myself? Does anyone have any examples of how to do this? William
2007 Jul 28
3
problem with a form
Hello I am trying to fill in a form using WWW::Mechanize. I can fill in 2 of the 3 fields but one is giving me a problem. The name of this field is "name" when I use the following bit of code, it seems to change the name of the form, not the value of the field. The part of original page after pretty printing {forms #<WWW::Mechanize::Form {name "wp_pers_form"}
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
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 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'' )
2007 Aug 21
7
Signin to LinkedIn
Hi, Does anyone have the formula for getting logged into LinkedIn? Here''s my current attempt: require ''rubygems'' require ''mechanize'' agent = WWW::Mechanize.new home_page = agent.get(''http://www.linkedin.com'') signin_page = agent.click home_page.links.text(''Sign in'') puts "\nSIGNIN PAGE"
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...
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 May 23
4
Error when posting form
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