Mechanize complex form input name
Posted
by ADAM
on Stack Overflow
See other posts from Stack Overflow
or by ADAM
Published on 2010-04-14T23:32:37Z
Indexed on
2010/04/14
23:33 UTC
Read the original article
Hit count: 300
Hi there i am trying to access a form in mechanize with ugly characters in the object name similar to this
agent = Mechanize.new
page = agent.get('http://domain.com)
form = page.forms[0]
form.ct600$Main$LastNameTextBox = "whatever"
page = agent.submit(form)
The problem is the $ in the html name is messing with ruby because Is there another method i could use ie:
form.element_by_name("ct600$Main$LastNameTextBox") = "whatever"
Unfortunately i cant change the html
© Stack Overflow or respective owner