Forum: Ruby mechanize

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1aca788091ce4af9b7eceffb8424e274?d=identicon&s=25 Manoj P M (Guest)
on 2007-03-15 14:02
(Received via mailing list)
Hi,

I am using mechanize library to do automated form posting. Unfortunately
it
doesn't seem to work for only gumtree.
Below is the snippet of code that I am using.  xxxxx represent the
acutual
post id and ziz value.  Similar code works for other web applications
only
gumtree fails.  Is it because, the form has a file upload control in it
?


require 'mechanize'
agent = WWW::Mechanize.new
agent.user_agent_alias = 'Windows IE 6'
page = agent.get("
http://www.gumtree.com/cgi-bin/email_poster.pl?pos...)

form = page.forms.with.name("email_friend").first

form.from_email = 'xyz@gmail.com'
form.message = "direct http post from code"
results = agent.submit(form)

Thanks
Manjo
Be30361bb0b0c495e3077db43ad84b56?d=identicon&s=25 Aaron Patterson (Guest)
on 2007-03-18 08:13
(Received via mailing list)
Hi Manjo,

On Thu, Mar 15, 2007 at 10:01:25PM +0900, Manoj P M wrote:
> Hi,
>
> I am using mechanize library to do automated form posting. Unfortunately it
> doesn't seem to work for only gumtree.
> Below is the snippet of code that I am using.  xxxxx represent the acutual
> post id and ziz value.  Similar code works for other web applications only
> gumtree fails.  Is it because, the form has a file upload control in it ?

How exactly do you know it is failing?  Can you be more specific?

Also, you may want to send this message to the mechanize users list:

  mechanize-users@rubyforge.org

Thanks!
20c6d66fff9453002a35f7623d4da735?d=identicon&s=25 Andy PS (abhionrails)
on 2007-04-18 09:20
m facing the execution timeout issue with myspace the code is working
fine on console but once you embed the code into my application its
shwing execution time out.
This topic is locked and can not be replied to.