Open-URI and percent sign in url

L

lrlebron

I am trying to use open-uri to open the following url
http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html#%_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-text/book/book-Z-H-4.html#%_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
 
L

lrlebron

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


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

Thanks. That worked!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top