title: how to get the current URL of a webpage in selenium-webdriver
body: <p>I am using selenium webdriver to do some automation on browser. now there is a need to get the current url of the page currently opened in the browser.</p>
  
  <p><em><strong>I wrote the below code but giving me error:</em></strong></p>
  
  <pre><code>element = driver.find_element :name =&gt; "btnSearch"
  element.click
  
  all_table_data = driver.find_elements(:tag_name, "td")
  
   all_table_data.each do |td|
  
     puts td.text
  
   end
  
   print driver.get_url
  </code></pre>
  
  <p><em><strong>But it is giving me an error:</em></strong></p>
  
  <pre><code>filedownload.rb:30:in `&lt;main&gt;': undefined method `get_url' for #&lt;Selenium::WebDr
  iver::Driver:0x4292df26 browser=:firefox&gt; (NoMethodError)
  </code></pre>
  
  <p>Can anyone help me here to fix it?</p>