T
Tao Ji
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. 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" # a
normal news page from 163.com
url_600036 = "http://quotes.163.com/corp/1036/code=600036.html" # a
stock info page from 163.com, this is problematic page
url_blank = "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}"
===============================================
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. 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" # a
normal news page from 163.com
url_600036 = "http://quotes.163.com/corp/1036/code=600036.html" # a
stock info page from 163.com, this is problematic page
url_blank = "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}"
===============================================