# Which script shall I choose for web automation?

**URL:** <https://www.ruby-forum.com/t/which-script-shall-i-choose-for-web-automation/120542>\
**Category:** Ruby\
**Created:** [November 18, 2007, 8:16am UTC](https://www.ruby-forum.com/t/which-script-shall-i-choose-for-web-automation/120542 "2007-11-18T08:16:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![campos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7bcc69/32.png) [@campos](https://www.ruby-forum.com/u/campos)\
**Post date:** [November 18, 2007, 8:16am UTC](https://www.ruby-forum.com/t/which-script-shall-i-choose-for-web-automation/120542/1 "2007-11-18T08:16:39Z")

</div>

Hi,

I’m trying to write an application which uses script to control web  
browser, such as inputing some data in the form, submitting, button  
clicking and so on. I wonder which script language is the best for  
such operations. As far as I know watir is good in Ruby. What about  
Python and others? Advantanges and disadvantages? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![campos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7bcc69/32.png) [@campos](https://www.ruby-forum.com/u/campos)\
**Post date:** [November 18, 2007, 8:41am UTC](https://www.ruby-forum.com/t/which-script-shall-i-choose-for-web-automation/120542/2 "2007-11-18T08:41:11Z")

</div>

campos wrote:

> Hi,
> 
> I’m trying to write an application which uses script to control web  
> browser, such as inputing some data in the form, submitting, button  
> clicking and so on. I wonder which script language is the best for  
> such operations. As far as I know watir is good in Ruby. What about  
> Python and others? Advantanges and disadvantages? Thanks in advance!

Do you need all the features of a browser? Such as visual images,  
JavaScript, CSS, etc.?

Or are you just trying to drive the servers’ program thru HTTP?

If the former, you need to use a browser and its scripting language. Try  
Selenium, Watir, or their ilk.

If the later, then you just need the HTTP protocol. Try HttpUnit in  
Java, or its equivalents in other languages. I think Perl has Mechanize.

And stay with Ruby, if you can!

---

<div class="post-metadata">

**Author:** ![campos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7bcc69/32.png) [@campos](https://www.ruby-forum.com/u/campos)\
**Post date:** [November 18, 2007, 8:53am UTC](https://www.ruby-forum.com/t/which-script-shall-i-choose-for-web-automation/120542/3 "2007-11-18T08:53:27Z")

</div>

Quoth Phlip:

> JavaScript, CSS, etc.?
> 
> –  
> Phlip

Ruby has mechanize also. If you don’t need human interaction (as Phlip  
said)  
and don’t have to work with javascript, Mechanize is perfect.

Regards,

---

<div class="post-metadata">

**Author:** ![campos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7bcc69/32.png) [@campos](https://www.ruby-forum.com/u/campos)\
**Post date:** [November 18, 2007, 8:47am UTC](https://www.ruby-forum.com/t/which-script-shall-i-choose-for-web-automation/120542/4 "2007-11-18T08:47:02Z")

</div>

On Nov 18, 2007 2:40 AM, Phlip [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> JavaScript, CSS, etc.?
> 
> Or are you just trying to drive the servers’ program thru HTTP?
> 
> If the former, you need to use a browser and its scripting language. Try  
> Selenium, Watir, or their ilk.
> 
> If the later, then you just need the HTTP protocol. Try HttpUnit in  
> Java, or its equivalents in other languages. I think Perl has Mechanize.

Ruby has mechanize too. [http://mechanize.rubyforge.org](http://mechanize.rubyforge.org)

---

<div class="post-metadata">

**Author:** ![campos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7bcc69/32.png) [@campos](https://www.ruby-forum.com/u/campos)\
**Post date:** [November 18, 2007, 9:11am UTC](https://www.ruby-forum.com/t/which-script-shall-i-choose-for-web-automation/120542/5 "2007-11-18T09:11:00Z")

</div>

On Nov 18, 3:37 pm, Phlip [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> JavaScript, CSS, etc.?
> 
> –  
> Phlip

I need visualization of the browser, emulation of human’s activities.  
Let me try Selenium and Watir. Thanks Phlip!

---

<div class="post-metadata">

**Author:** ![campos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7bcc69/32.png) [@campos](https://www.ruby-forum.com/u/campos)\
**Post date:** [November 18, 2007, 9:35am UTC](https://www.ruby-forum.com/t/which-script-shall-i-choose-for-web-automation/120542/6 "2007-11-18T09:35:32Z")

</div>

On Nov 18, 3:46 pm, Michael G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > If the former, you need to use a browser and its scripting language. Try  
> > Selenium, Watir, or their ilk.
> 
> > If the later, then you just need the HTTP protocol. Try HttpUnit in  
> > Java, or its equivalents in other languages. I think Perl has Mechanize.
> 
> Ruby has mechanize too.[http://mechanize.rubyforge.org](http://mechanize.rubyforge.org)

Cool. It seems making a choice is really hard.

---

<div class="post-metadata">

**Author:** ![campos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7bcc69/32.png) [@campos](https://www.ruby-forum.com/u/campos)\
**Post date:** [November 18, 2007, 9:56am UTC](https://www.ruby-forum.com/t/which-script-shall-i-choose-for-web-automation/120542/7 "2007-11-18T09:56:35Z")

</div>

On Nov 18, 4:34 pm, campos [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > campos wrote:
> 
> Cool. It seems making a choice is really hard.
> 
> > - Show quoted text – Hide quoted text -
> 
> - Show quoted text – Hide quoted text -
> 
> - Show quoted text -

Find an article that really makes sense.

> **[Open Source | Thoughtworks](https://www.thoughtworks.com/insights/topic/open-source)**
>
> We are serious about our craft and always striving to improve the way we do things. Our technologists bring successful, field-tested techniques and ideas from around the globe to open source solutions. We contribute to and use open-source software...
