open-uri have been working fine, until I used it to open http://www.mov99.com/movie/poster/2002081800574.html, when it returned a empty string. I don't know what is the problem. Is there any page that can not be open with open-uri? or I need some special argument to read it?
on 2007-04-26 17:37
on 2007-04-26 19:04
I don't have time to take a close look right now, but when I had this problem playing with web robots, it was first because some sites required a user-agent string from a common web browser. The internet says you can use open-uri as follows: open(uri, "User-Agent" => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)' Or other user agent--the above is for Internet Explorer. Good luck, Dan
on 2007-04-26 20:44
Dan Zwell wrote: > open(uri, "User-Agent" => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT > 5.1)' It works. Thanks