On Jan 27, 2009, at 8:35 PM, Don French wrote:
> 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 /usr/local/ruby/lib/ruby/1.8/uri/common.rb:485:in `parse'
>        from /usr/local/ruby/lib/ruby/1.8/open-uri.rb:29:in `open'
>
> The problem is, if I paste the url in a browser it does go to the
> proper page.  What am I missing

Try replacing the | characters with %7C

Or try:

doc = Nokogiri::HTML(open(URI.encode(url)))

-Rob

Rob Biedenharn          http://agileconsultingllc.com
[email protected]



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to