in reply to Re: How to Enter a value to a field without having name in WWW-Mechanize-Firefox
in thread How to Enter a value to a field without having name in WWW-Mechanize-Firefox

Thanks Monk, I read that before asking this question(+ documentation + cookbook also)! I am just a beginner and I didn't find a way to do that, that's why I asked here.

I may click through Xpath, but how will I enter a value there?(Pls check the mentioned site Source code!, Did you checked it?)

Here, the beginners like me are asking for solutions & not an amazing advice.

  • Comment on Re^2: How to Enter a value to a field without having name in WWW-Mechanize-Firefox

Replies are listed 'Best First'.
Re^3: How to Enter a value to a field without having name in WWW-Mechanize-Firefox
by Anonymous Monk on Nov 05, 2012 at 02:50 UTC

      To enter a value to a field, we need the "name" normally, like  $mech->field(name => $value) and here i do not have a name associated with it. Pls check the below Source code for that

      <input class="getaquotepagezipcodefield" id="iaQuoteByZip" type="text" style="background-color: rgb(255, 255, 255); ">

      Or Can we do it some other way? I don't know and I didn't see it till now. Also how can we enter a value to a field using Xpath, Can you pls give a code here

        I already told you, use an xpath

        firefox plugins xpather can help you with write xpaths

      Man, I am really sorry! Actually my manager is kicking me on my head, that's why loosing my control. :)

      Actually I need to write a pincode like "10027" on a field. and for that we can use like  $mech->field( user => 'joe' ); where 'user' stands for the 'name' attribute. but in my case there is no name associated to it. pls see the code below,

      <input class="getaquotepagezipcodefield" id="iaQuoteByZip" type="text" style="background-color: rgb(255, 255, 255); ">

      Here there is no 'name' attribute, all you got is 'class', 'id', 'type', 'style' (and no 'name'). then how can we use this code,  $mech->field( user => 'joe' ); ? Or can we modify this code?, If possible pls write the code here. I am fed up! Thanks!

        "If possible pls write the code here"

        This is not a code writing service.

        "Actually my manager is kicking me on my head, that's why loosing my control."

        "I am fed up!"

        Consider telling your manager that you are either unable or unwilling to learn how to use the tools in question to complete the task you've been given.

    A reply falls below the community's threshold of quality. You may see it by logging in.