# URI.parse errors!

**URL:** <https://www.ruby-forum.com/t/uri-parse-errors/159387>\
**Category:** Ruby\
**Created:** [February 4, 2009, 4:20am UTC](https://www.ruby-forum.com/t/uri-parse-errors/159387 "2009-02-04T04:20:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [February 4, 2009, 4:20am UTC](https://www.ruby-forum.com/t/uri-parse-errors/159387/1 "2009-02-04T04:20:54Z")

</div>

```
  resp = Net::HTTP.get(URI.parse("http:#{img['src']}"))

```

thats the line that is making this error:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/uri/common.rb:436:in  
`split’: bad URI(is not URI?):  
[![](https://images.slashdot.org/articles/09/02/03/1620213-1-thumb.png) ](https://images.slashdot.org/articles/09/02/03/1620213-1-thumb.png)  
(URI::InvalidURIError)

How is it invalid? 😢

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [February 4, 2009, 12:35pm UTC](https://www.ruby-forum.com/t/uri-parse-errors/159387/2 "2009-02-04T12:35:25Z")

</div>

Tim M. wrote:

> ```
> resp = Net::HTTP.get(URI.parse("http:#{img['src']}"))
> 
> ```
> 
> thats the line that is making this error:
> 
> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/uri/common.rb:436:in  
> `split’: bad URI(is not URI?):  
> [http://images.slashdot.org/articles/09/02/03/1620213-1-thumb.png](http://images.slashdot.org/articles/09/02/03/1620213-1-thumb.png)  
> (URI::InvalidURIError)
> 
> How is it invalid? 😢  
> What are the contents of img[‘src’]… do they include the leading  
> //'s required to make this a good URI?

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [February 4, 2009, 3:31pm UTC](https://www.ruby-forum.com/t/uri-parse-errors/159387/3 "2009-02-04T15:31:05Z")

</div>

> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/uri/common.rb:436:in  
> `split’: bad URI(is not URI?):  
> [http://images.slashdot.org/articles/09/02/03/1620213-1-thumb.png](http://images.slashdot.org/articles/09/02/03/1620213-1-thumb.png)  
> (URI::InvalidURIError)
> 
> How is it invalid? 😢

Well, according to my irb, it isnt →

> >

URI.parse(“[http://images.slashdot.org/articles/09/02/03/1620213-1-thumb.png](http://images.slashdot.org/articles/09/02/03/1620213-1-thumb.png)”)  
=\> #\<URI::HTTP:0xb7ade668  
URL:[http://images.slashdot.org/articles/09/02/03/1620213-1-thumb.png](http://images.slashdot.org/articles/09/02/03/1620213-1-thumb.png)\>

So it must be something about img[‘src’], you should #inspect it.
