# Firebug (?) displays Ruby code to get/set HTML element

**URL:** <https://www.ruby-forum.com/t/firebug-displays-ruby-code-to-get-set-html-element/172547>\
**Category:** Ruby\
**Created:** [July 23, 2009, 6:38am UTC](https://www.ruby-forum.com/t/firebug-displays-ruby-code-to-get-set-html-element/172547 "2009-07-23T06:38:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbaty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3bc359/32.png) [@jbaty](https://www.ruby-forum.com/u/jbaty)\
**Post date:** [July 23, 2009, 6:38am UTC](https://www.ruby-forum.com/t/firebug-displays-ruby-code-to-get-set-html-element/172547/1 "2009-07-23T06:38:31Z")

</div>

Several months ago I used a Firefox/Firebug extension that displayed the  
Ruby code (python too IIRC) needed to get and/or set a selected HTML  
element.

Now I can’t find it again and it’s making me crazy.

I have googled and FAQ’d my butt off but no dice. I’d even consider  
paying a Ruby wizard to help me find this, if neccy. cb0   
me com

PLEASE help!!!

CB

PS. It may even not be a Firefox thingie — I just can’t imagine what  
else it would be. I use Mac OS X, and can’t find it in Safari either.

---

<div class="post-metadata">

**Author:** ![jbaty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3bc359/32.png) [@jbaty](https://www.ruby-forum.com/u/jbaty)\
**Post date:** [July 23, 2009, 7:23pm UTC](https://www.ruby-forum.com/t/firebug-displays-ruby-code-to-get-set-html-element/172547/2 "2009-07-23T19:23:48Z")

</div>

huh? since when does firebug use ruby?  
i think you’re mistaken here. AFAIK that’s all javascript

Greetz

2009/7/23 Jack B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![jbaty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3bc359/32.png) [@jbaty](https://www.ruby-forum.com/u/jbaty)\
**Post date:** [July 24, 2009, 1:27am UTC](https://www.ruby-forum.com/t/firebug-displays-ruby-code-to-get-set-html-element/172547/3 "2009-07-24T01:27:27Z")

</div>

Fabian S. wrote:

> huh? since when does firebug use ruby?  
> Greetz

It’s a Firefox/Firebug EXTENSION, not a native function.

Here’s how it worked:  
You browsed to a website of interest, then selected a field on the page.  
The extension I am looking for would display, in a separate window, the  
Ruby (or optionally Python) expression needed to access that field  
(under the Ruby OSA interface to Apple Script).

I am not dreaming this — I used it several times about 10 months ago  
— but I cant remember its name or find it thru google.

I will admit my OP was very confusing.

Thx

---

<div class="post-metadata">

**Author:** ![jbaty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3bc359/32.png) [@jbaty](https://www.ruby-forum.com/u/jbaty)\
**Post date:** [July 24, 2009, 3:57am UTC](https://www.ruby-forum.com/t/firebug-displays-ruby-code-to-get-set-html-element/172547/4 "2009-07-24T03:57:36Z")

</div>

On Jul 23, 7:26 pm, Jack B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Fabian S. wrote:
> 
> > huh? since when does firebug use ruby?  
> > Greetz
> 
> It’s a Firefox/Firebug EXTENSION, not a native function.
> 
> Here’s how it worked:  
> You browsed to a website of interest, then selected a field on the page.  
> The extension I am looking for would display, in a separate window, the  
> Ruby (or optionally Python) expression needed to access that field

That’s neat, but it’s not hard to put a

doc.at( )

around an XPath (Nokogiri syntax) that you get from Firebug or another  
tool. Note, however, that you will get superior results crafting the  
XPath yourself rather than blindly taking output from DOM-based tools.  
See  
[http://groups.google.com/group/comp.lang.ruby/browse\_thread/thread/7a7b347d46410467/2317d10bf6c4c1e3?hl=en#2317d10bf6c4c1e3](http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/7a7b347d46410467/2317d10bf6c4c1e3?hl=en#2317d10bf6c4c1e3)  
for a discussion.
