« Return to Thread: Get a web page with open-uri

Re: Get a web page with open-uri

by Andy P. :: Rate this Message:

Reply to Author | View in Thread

Glenn Jackman wrote:

> At 2009-07-08 05:52AM, "Andy P." wrote:
>>  Hello !
>>  
>>  I'm trying to get a web page width open-uri width this code :
>>  
>>  require 'open-uri'
>>  open("http://www.google.com") {|src|
>>    open("test.htm","wb") {|dst|
>
> You're looking for the class method in File:
>
>      File.open("test.htm","wb") {|dst|


Yes but it don't work with :
open("www.google.com") {|src|

I'm not trying that in irb, I imported all the files of uri, open-uri,
but it don't work. What is the full name of the open uri method who
creates a TempFile ?
Must I import other files ?

Thanks.
--
Posted via http://www.ruby-forum.com/.

 « Return to Thread: Get a web page with open-uri