Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Open-URI and percent sign in url

Reply
Thread Tools

Open-URI and percent sign in url

 
 
lrlebron@gmail.com
Guest
Posts: n/a
 
      09-27-2007
I am trying to use open-uri to open the following url
http://mitpress.mit.edu/sicp/full-te...ml#%_toc_start
and I'm getting the following error

:/ruby/lib/ruby/1.8/uri/common.rb:436:in `split': bad URI(is not
URI?): http://mitpress.mit.edu/sicp/full-te...ml#%_toc_start
(URI::InvalidURIError)
from c:/ruby/lib/ruby/1.8/uri/common.rb:485:in `parse'
from c:/ruby/lib/ruby/1.8/open-uri.rb:29:in `open'
from mitbook.rb:14

However, the url works fine in the browser.


thanks,

Luis

 
Reply With Quote
 
 
 
 
Eric Hodel
Guest
Posts: n/a
 
      09-27-2007
On Sep 27, 2007, at 08:58 , http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> I am trying to use open-uri to open the following url
> http://mitpress.mit.edu/sicp/full-te...k-Z-H-4.html#%
> _toc_start
> and I'm getting the following error


%_t is not a valid % escape sequence. You probably want ...#%25_toc...

> However, the url works fine in the browser.


The browser is more forgiving, which is nice for people like my parents.

 
Reply With Quote
 
 
 
 
lrlebron@gmail.com
Guest
Posts: n/a
 
      09-27-2007
On Sep 27, 11:15 am, Eric Hodel <(E-Mail Removed)> wrote:
> On Sep 27, 2007, at 08:58 , (E-Mail Removed) wrote:
>
> > I am trying to use open-uri to open the following url
> >http://mitpress.mit.edu/sicp/full-te...k-Z-H-4.html#%
> > _toc_start
> > and I'm getting the following error

>
> %_t is not a valid % escape sequence. You probably want ...#%25_toc...
>
> > However, the url works fine in the browser.

>
> The browser is more forgiving, which is nice for people like my parents.


Thanks. That worked!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sprintf percent sign problem mpthimios@gmail.com Ruby 2 11-04-2007 07:15 PM
sprintf percent sign problem mpthimios@gmail.com Ruby 2 11-04-2007 12:30 PM
Apache, perl and WinXP cmd.exe - problem with percent sign in arg list Bartek Lakomiec Perl Misc 4 04-05-2007 03:02 AM
Printing a percent sign stephen@theboulets.net Python 13 09-26-2006 01:02 PM
Passing percent sign in querystring Joey Martin ASP General 11 04-22-2005 06:29 PM



Advertisments