# Net::HTTP.get(...) not working (still)

**URL:** <https://www.ruby-forum.com/t/net-http-get-not-working-still/49049>\
**Category:** Ruby\
**Created:** [November 21, 2005, 8:43am UTC](https://www.ruby-forum.com/t/net-http-get-not-working-still/49049 "2005-11-21T08:43:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michelle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6de8d8/32.png) [@michelle](https://www.ruby-forum.com/u/michelle)\
**Post date:** [November 21, 2005, 8:43am UTC](https://www.ruby-forum.com/t/net-http-get-not-working-still/49049/1 "2005-11-21T08:43:26Z")

</div>

Now that I’ve got my DNS back, I’m still getting the same basic error I  
had last time around, complaining: undefined method ‘line’

Help?

* * *

def fromWeb(site, url)  
# get data from website  
h = Net::HTTP.new(site, 80)  
resp=h.get(url) do  
# process data  
|line|  
if /DGM\_navigation/ =~ line do  
# decode page lineage  
step=Array.new  
astep, line = getNextWord(line)  
while astep != nil  
step.push(astep)  
astep, line = getNextWord(line)  
end  
puts “Page Lineage”  
indent = 0  
step.each do  
|astep|  
indent.each do  
put " "  
end  
puts astep  
indent += 1  
end  
end # end DGM\_naviation  
end # end Net::HTTP.get  
end # end def fromWeb

---

<div class="post-metadata">

**Author:** ![michelle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6de8d8/32.png) [@michelle](https://www.ruby-forum.com/u/michelle)\
**Post date:** [November 21, 2005, 3:31pm UTC](https://www.ruby-forum.com/t/net-http-get-not-working-still/49049/2 "2005-11-21T15:31:42Z")

</div>

On 11/21/05, Lady Michelle B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> h = Net::HTTP.new(site, 80)  
> end  
> end # end DGM\_naviation  
> end # end Net::HTTP.get  
> end # end def fromWeb

Minor syntax error on your part

if’s syntax is  
if cond  
…  
end

not

if cond do # calls cond with the block  
…  
end
