# Why this web page stop my "open" action \[open-uri\]?

**URL:** <https://www.ruby-forum.com/t/why-this-web-page-stop-my-open-action-open-uri/182871>\
**Category:** Ruby\
**Created:** [February 4, 2010, 4:47am UTC](https://www.ruby-forum.com/t/why-this-web-page-stop-my-open-action-open-uri/182871 "2010-02-04T04:47:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxlion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/df788c/32.png) [@maxlion](https://www.ruby-forum.com/u/maxlion)\
**Post date:** [February 4, 2010, 4:47am UTC](https://www.ruby-forum.com/t/why-this-web-page-stop-my-open-action-open-uri/182871/1 "2010-02-04T04:47:49Z")

</div>

Hello,  
Need your help to find out what stop my “open” action. I’m using  
open-uri to get the webpages from [http://quotes.163.com](http://quotes.163.com). When I try open  
other pages it works pefectly but spit out errors when I try to get the  
stock quote information.

Can you give me some hints?

# Below is my sample code:

# require “open-uri” url\_news = “[http://news.163.com/10/0204/01/5UL33070000120GR.html](http://news.163.com/10/0204/01/5UL33070000120GR.html)” # a normal news page from [163.com](http://163.com) url\_600036 = “[http://quotes.163.com/corp/1036/code=600036.html](http://quotes.163.com/corp/1036/code=600036.html)” # a stock info page from [163.com](http://163.com), this is problematic page url\_blank = “[http://news.163.com/10/0204/01/5UL22070000120GR.html](http://news.163.com/10/0204/01/5UL22070000120GR.html)” # a request to a nonexisted page #response = open(url\_news) # I can go smoothly #response = open(url\_blank) # also no error response = open(url\_600036) # Yes error comes here puts “Character set is #{response.charset}” puts “Size is #{response.size}”

---

<div class="post-metadata">

**Author:** ![maxlion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/df788c/32.png) [@maxlion](https://www.ruby-forum.com/u/maxlion)\
**Post date:** [February 4, 2010, 5:28am UTC](https://www.ruby-forum.com/t/why-this-web-page-stop-my-open-action-open-uri/182871/2 "2010-02-04T05:28:40Z")

</div>

On Feb 3, 10:50 pm, Tao Ji [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> # require “open-uri” puts “Size is #{response.size}”
> 
> –  
> Posted viahttp://www.ruby-forum.com/.

Is the error you’re getting “SocketError: getaddrinfo: Name or service  
not known”?

If not, copy and paste the full error.
