search for: to_absolute_uri

Displaying 7 results from an estimated 7 matches for "to_absolute_uri".

2006 Nov 22
1
to_absolute_uri typo in 0.6.3?
...that, but one of the sites I''m scraping does a redirect on form submission to a badly-formed relative URL: index.cfm?action=bing&bang=boom=1|a=|b=|c= (etc.) Interestingly, Mechanize 0.6.2 handled this OK, but in 0.6.3 this causes a URI::InvalidURIError exception from URI.parse() in to_absolute_uri in mechanize.rb. I noticed that the new 0.6.3 version of to_absolute_uri starts with: url = URI.parse( URI.unescape(Util.html_unescape(url.to_s.strip)).gsub(/ /, ''%20'') ) unless url.is_a? URI where the old 0.6.2 version started with:...
2007 Jan 12
0
why dose to_absolute_uri use URI.escape?
....8/lib/ruby/1.8/uri/common.rb:432:in `split'': bad URI(is not URI?): http://ja.wikipedia.org/wiki/??????????? (URI::InvalidURIError) from C:/opt/ruby-1.8/lib/ruby/1.8/uri/common.rb:481:in `parse'' from C:/opt/ruby-1.8/lib/ruby/gems/1.8/gems/mechanize-0.6.4/lib/mechanize.rb:272:in `to_absolute_uri'' from C:/opt/ruby-1.8/lib/ruby/gems/1.8/gems/mechanize-0.6.4/lib/mechanize.rb:141:in `get'' from sample.rb:6 to_absolute_uri in mechanize.rb url = URI.parse( URI.unescape(Util.html_unescape(url.to_s.strip)).gsub(/ /, ''%20'')...
2006 Dec 30
0
Change I needed to make in to_absolute_uri for unescaped URL separator characters
Mechanize is great! It''s better than anything I was expecting to be out there, and the syntax is really nice. I had a bit of a problem though -- following URLs with commas. The code in to_absolute_uri works great for spaces, but some pages I was working on had URLs with unescaped commas that URI rejected when I tried to click() on them. So I changed the first statement in Mechanize#to_absolute_uri to: url = URI.parse( URI.unescape( Util.html_unescape(url.to_s.strip)).gsub(/[ ,]/){...
2007 Oct 10
1
Scraping AOL Webmail to login and fetch contacts?
I''m helping with a gem that is going to published under the contentfree project on rubyforge (http://rubyforge.org/projects/contentfree/). The gem is called "blackbook" and basically it will go and fetch your contacts from the major webmail providers. So far Gmail, Yahoo!, and MSN have been completed. We are trying to finish up with fetching contacts from AOL Webmail. However
2007 Mar 20
6
bad URI problem when submitting a form
Hi all, I''ve a problem when submitting a form : the URL seems to be invalid. I really don''t see the way I should try to solve that problem. I searched on the web, but didn''t found any kind of that problem. Here is the code : require ''mechanize'' agent = WWW::Mechanize.new page =
2007 Nov 14
0
Hpricot & mechanize fail to parse page after redirect1q
...; Mechanize gives the following message: "NoMethodError: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.last" from C:/Web/ruby/lib/ruby/gems/1.8/gems/mechanize-0.6.10/lib/mechanize.rb:402:in `to_absolute_uri'' I have tested this on 2 different machines, and they both break down. Can someone please give it a go and see if they can figure it out? I would be very very thankful :) Thanks, Ehud PS - I am using hpricot 0.6, and the redirected page is parsed correctly when accessed directly. ------...
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