# How can I save the current browser title to a variable?

**URL:** <https://www.ruby-forum.com/t/how-can-i-save-the-current-browser-title-to-a-variable/127740>\
**Category:** Ruby\
**Created:** [January 31, 2008, 9:19pm UTC](https://www.ruby-forum.com/t/how-can-i-save-the-current-browser-title-to-a-variable/127740 "2008-01-31T21:19:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddad01](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@ddad01](https://www.ruby-forum.com/u/ddad01)\
**Post date:** [January 31, 2008, 9:19pm UTC](https://www.ruby-forum.com/t/how-can-i-save-the-current-browser-title-to-a-variable/127740/1 "2008-01-31T21:19:36Z")

</div>

I’m new to Ruby, but I cannot find a way to get the browser title.

any help would be great.

Thanks

---

<div class="post-metadata">

**Author:** ![ddad01](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@ddad01](https://www.ruby-forum.com/u/ddad01)\
**Post date:** [February 1, 2008, 2:10am UTC](https://www.ruby-forum.com/t/how-can-i-save-the-current-browser-title-to-a-variable/127740/2 "2008-02-01T02:10:51Z")

</div>

On Jan 31, 3:19 pm, Darin D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m new to Ruby, but I cannot find a way to get the browser title.
> 
> any help would be great.
> 
> ## Thanks
> 
> Posted viahttp://www.ruby-forum.com/.

This depends on the relationship between your Ruby code and the  
browser.

One case is that your Ruby program is running along side the browser  
on the same computer. This is the case with the watir gem, for  
example. In this case, you can interact with Internet Explorer using  
Ruby’s Win32OLE library.

In the case of Ruby on Rails, your Ruby program is communicating with  
a client browser via HTTP. In this case, you can have some client-  
side JavaScript get the browser title and send the information as an  
HTTP parameter to your Ruby on Rails program.
