title: Ruby agent.click page.links.text iframe interrupts
body: <p>I dont know if the title is appropriate but i expect some help. I was searching for a way to send sms using Linux terminal and I found a script. The script is in Ruby, and looks good. I am not familiar with Ruby but the code is well explained so that an average can use it easily. </p>
  
  <pre><code>require 'mechanize'
  number   = ARGV.shift
  message  = ARGV * " "
  
  if message.length &gt; 160 || message.length &lt; 1
    $stderr.puts "Message too short or too long.."
    exit 1
  end
  
  agent = WWW::Mechanize.new
  
  page = agent.get('http://www.xxxxxx.com/')
  hp_formlogin = page.form('login')
  hp_formlogin.username = 'xxxxxxxx'
  hp_formlogin.pass = 'xxxxxxxx'
  page = agent.submit(hp_formlogin)
  
  #ONLY USED IF YOUR SITE REDIRECTS YOU AFTER LOGIN
  page = agent.click page.links.text('Send Free SMS')
  pp page
  
  page = agent.get('http://www.xxxxxxxx.com/send/free-sms')
  #ONLY USED IF THERE'S NO NAME FOR THE FORMFIELD.
  # SO IF YOU HAVE ONE, COMMENT OUT THE LINE BELOW AND ENTER THIS
   hp_formsms = page.form('freesms2')
  #hp_formsms = page.forms.first
  hp_formsms.frno = number
  hp_formsms.message3 = message
  page = agent.submit(hp_formsms)
  </code></pre>
  
  <p>This is the code... But the issue is that, on login into the site, It shows an intermediate frame(iframe I think) before getting into the profile. So that the page = agent.click page.links.text('Send Free SMS') is not working. This is because, this frame does not have a link named send free sms. This have a close button made from an image. How can I get into the profile page bypassing this frame and send message. 
  Please help.. Any help is welcome.</p>