# GET doesnt seem to work in this case

**URL:** <https://www.ruby-forum.com/t/get-doesnt-seem-to-work-in-this-case/57842>\
**Category:** Ruby\
**Created:** [April 14, 2006, 7:51pm UTC](https://www.ruby-forum.com/t/get-doesnt-seem-to-work-in-this-case/57842 "2006-04-14T19:51:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSMKSM](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@SSMKSM](https://www.ruby-forum.com/u/SSMKSM)\
**Post date:** [April 14, 2006, 7:51pm UTC](https://www.ruby-forum.com/t/get-doesnt-seem-to-work-in-this-case/57842/1 "2006-04-14T19:51:15Z")

</div>

Hello,

I’m trying to grab some info off [www.yellowbook.com](http://www.yellowbook.com) for a specific city.

While testing a simple program to just grab the index page i couldnt  
manage to get it working. Here’s what i have so far.

http = Net::HTTP.new(‘[www.yellowbook.com](http://www.yellowbook.com)’, 80)  
res = http.send\_request(‘GET’, ‘/’)  
p res.body

I get a object moved page all the time. I tested it with my browser  
and it works perfectly. Could anyone kindly point what im doing wrong  
here? Perhaps this method is not appropriate for this task…

Thanks,

Ricardo Amorim

---

<div class="post-metadata">

**Author:** ![SSMKSM](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@SSMKSM](https://www.ruby-forum.com/u/SSMKSM)\
**Post date:** [April 14, 2006, 8:00pm UTC](https://www.ruby-forum.com/t/get-doesnt-seem-to-work-in-this-case/57842/2 "2006-04-14T20:00:27Z")

</div>

|MKSM| wrote:

> I get a object moved page all the time. I tested it with my browser  
> and it works perfectly. Could anyone kindly point what im doing wrong  
> here? Perhaps this method is not appropriate for this task…

I think your browser is automatically handling the “object moved”  
response and issuing a second request to the new URL.

Your client code will either have to parse the response and make a new  
request if it gets a “moved” response, or you can just use that new URL  
as the the starting point.

–  
James B.

?Design depends largely on constraints.?  
? Charles Eames
