Displaying 20 results from an estimated 1100 matches similar to: "why dose to_absolute_uri use URI.escape?"
2006 Nov 22
1
to_absolute_uri typo in 0.6.3?
I just started using Mechanize, and started using Ruby about thirty
seconds before 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
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
2007 Nov 14
0
Hpricot & mechanize fail to parse page after redirect1q
Hi everyone,
My quest with mechanize/Hpricot continues :)
Something extremely strange happened today - some simple working code broke
down, and i can''t figure out why.
I am trying to access a piratebay.org search page, which does a redirect to
a relative url like this:
original link:
http://thepiratebay.org/s/?page=0&orderby=3&q=football+manager+2008&searchTitle=on
redirects
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 =
2008 Nov 03
2
Multiple Submit Buttons
Hello.
I have run into a new form that contains multiple submit buttons.
Currently my code for working with forms looks just like this example.
require ''rubygems''
require ''mechanize''
a = WWW::Mechanize.new { |agent|
agent.user_agent_alias = ''Mac Safari''
}
a.get(''http://google.com/'') do |page|
2007 Apr 20
2
Running script does not return the correct page
Hello all,
I have tried to post this yesterday, but noticed I was actually not
subscribed yet... Well, here we go again:
If I run this script, and observe the output, the results are not there
at all (try to do the same in the browser). Any suggestions?
require ''rubygems''
require ''mechanize''
agent = WWW::Mechanize.new
agent.user_agent_alias =
2007 May 06
1
How to submit this form?
Hey all,
maybe I am missing the obvious again, but I can not submit the form on
buy.com:
require ''rubygems''
require ''mechanize''
agent = WWW::Mechanize.new
agent.user_agent_alias = ''Mac Safari''
page = agent.get("http://www.buy.com")
search_form = page.forms.with.name("searchbox").first
p search_form.buttons
the last
2007 Apr 19
1
Do you have any idea what could be the problem with this script?
Hello all,
If I run this script, and observe the output, the results are not there
at all (try to do the same in the browser). Any suggestions?
require ''rubygems''
require ''mechanize''
agent = WWW::Mechanize.new
agent.user_agent_alias = ''Mac Safari''
page =
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
2009 Sep 25
0
WWW::Mechanize and Rails console not playing well
I can run this code just fine in irb, but when I run it in rails
script/console, I get an error:
>> res = agent.submit(search_form, search_form.buttons.first)
ArgumentError: one hash required
from /home/jwoods/NetBeansProjects/activista/vendor/rails/
actionmailer/lib/../../actionpack/lib/../../activesupport/lib/
active_support/core_ext/string/interpolation.rb:85:in `%''
2009 Jun 22
2
URI::InvalidURIError with open-uri and Google Maps
Hello,
I''m getting an URI::InvalidURIError in my controller when I use german
characters in the uri. Google accepts them but open-uri not. How to
encode them?
That''s my controller simplified:
def index
require ''open-uri''
address = "Bürgerstraße+68+01127+Dresden"
api_key = "my api key"
json =
2009 Sep 17
1
Load Error Using Mechanize Gem
Hi,
I''m getting a "Could not open any of [xml2, xslt, exslt] (LoadError)" error when trying to run a simple Ruby program taken from the EXAMPLES.rdoc file of the Mechanize gem.
The error is in this line of the Nokogiri module of libxml.rb: ffi_lib ''xml2'', ''xslt'', ''exslt''
Not sure if there are missing gems, and if so,
2011 Mar 27
2
LinkedIn still not working?
To clarify the issue I posted earlier:
I am on OS X 10.6.7. Trying to use Mechanize to log in to LinkedIn. As others have posted about in the past, when I submit the form it kicks me back to the LinkedIn landing page, and does not log me in.
I read the earlier discussion of the issue that mentioned how cookie values were being improperly dequoted when stored. But I thought that issue was fixed.
2012 Dec 19
0
(no subject)
hello,
I have a problem, I want to do is get a certificate .p12, I am
implementing the following code:
m= Mechanize.new
m.log = Logger.new "m.log"
m.user_agent_alias = "Mac Safari"
if RbConfig::CONFIG["host_os"] =~ /mingw|mswin/
ca_path = File.expand_path "C:/Users/amdx3/Desktop/cacert.p12"
m.agent.http.ca_file = ca_path
2008 Apr 26
1
gem fetching error
I am trying to install some application using gem, but I keep on getting
the error. I tried with ''gem clean'' and ''gem update''. The latter gives
the following error (the same error is replicable when I try any ruby
applications):
# gem update --debug
Exception `Errno::ENOENT'' at
/usr/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51 - No such file or
2007 Oct 04
2
newbie question with login form
hi,
i''m just starting to work with this incredible tool...
but i got a first problem with the login process
i''m logging on my app like this :
------
@agent = WWW::Mechanize.new { |a| a.log = Logger.new("mech.log") }
@agent.user_agent_alias = ''Mac Safari''
@page = @agent.get("http://myappAdress/")
@form = @page.forms.first
2009 Jan 28
2
open_uri failure on good uri.
I am trying to open a URI using doc = Nokogiri::HTML(open(url)). I get
the following error:
URI::InvalidURIError: bad URI(is not URI?):
http://www.mauipropertytax.com/Datalets.asp?mnu=PSearch&submnu=Profile&pin=390350950000&tp=2&cp=1&State=1|1|*&item=1
from /usr/local/ruby/lib/ruby/1.8/uri/common.rb:436:in `split''
from
2009 Sep 11
2
Installing Rails problem
I have installed Ruby and Apache, but when tried to install Rails (sudo
gem install rails --include-dependencies) I have got an error:
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
ERROR: While executing gem ... (URI::InvalidURIError)
the scheme http does not accept registry part: :8080 (or bad
hostname?)
2007 Nov 12
3
Weird error downloading a gzip''ed file
Hi all,
I''ve been using mechanize for a while and it rocks. Docs are pretty clear
and so far I''ve been able to do it on my own.
However, I''m stuck in a weird situation in a script to download my contact
list from hotmail.
I''ve used Firebug to check all urls, and tested it by hand while logged in
via browser.
Even in the script everything works well until the
2007 May 20
0
Urgent :: File Object problem
disclaimer: Im not a developer, in fact I know very little of Ruby.
I had this script made for me by Endax, LLC. I have run into problems
with the script and they are unable/unwilling to help resolve the issue.
The script was working fine for a while, but now when I run it I get the
following error in the Ruby editor:
>ruby realtor_scraper.rb
realtor_scraper.rb:54:in `initialize'':