From: Meihua Liang Date: 2004-01-31T04:49:52+09:00 Subject: Re: Net::http.get has a 50K limit? Yes the server completes the document. Browser serves it nicely, and I also verified via wget, which give the complete copy. I still don't know why Net::http prematurely cuts off the document. meihua "Robert Klemme" wrote in message news:bve0ff$qsaln$1@ID-52924.news.uni-berlin.de... > > "Meihua Liang" schrieb im Newsbeitrag > news:YXuSb.11834$fZ6.7987@lakeread06... > > I tried your suggestion (ie. using a block and putting it to a file: > see > > copy below) but it still cuts the page short just as before. The actual > web > > page is ~58K but I'm only getting ~51K. Any more suggestions? > > Did you verify with wget that the server actually serves the complete > document? If not, that's what I'd do. > > robert > > > > > require "net/http" > > # using block > > Net::HTTP.start("www.washingtonpost.com", 80){ |http| > > File.open('result.txt', 'wb+') {|f| > > resp,=http.get('/wl/jobs/JS_JobSearch?TS=1012409733026',nil) > { > > |str| > > f.print( str ) > > } > > } > > } > > > > > > "Vivek Nallur" wrote in message > > news:Pine.WNT.4.58.0401301052560.536@Vajra.CDACMUMBAI.CDACINDIA.COM... > > > Just a small change required. > > > > > > |require "net/http" > > > |begin > > > | Net::HTTP.start("www.washingtonpost.com", 80){ |http| > > > | response , = http.get("/wl/jobs/JS_JobSearch?TS=1012409733026") > > > > > > File.open("/some/file/","wb+"){|f| > > > resp, = http.get(url, nil){|gotit| > > > f.print(gotit) > > > } > > > } > > > > > > > > > | data=response.body > > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > > > > The data is not part of the response any more. This behaviour has > changed > > > from ruby 1.6 > > > > > > regs > > > Vivek > > > > > > > > > | puts data.length > > > | } > > > |rescue => err > > > | puts "Error: #{err}" > > > | exit > > > |end > > > | > > > |The last line returns 52166 . (the file is considerable bigger) What > did > > I > > > |do wrong? > > > | > > > | > > > | > > > | > > > > > > -- > > > > > > Accept that some days you are the pigeon and some days the statue > > > > > > > > > > > > > >