1

I'm trying to fill some unnamed fields using $mech->fields but I ran out of hair on my head to pull off, please help.

<input id="af-city" class="input-field af-city" autocomplete="address-level2" type="text" aria-required="true" placeholder="">
<input id="af-zip" class="input-field postal-code-validate af-zip" autocomplete="postal-code" type="text" aria-required="true" placeholder="">

have tried using xpath, no use, adding a dot or a hash in front of the id to let $mech know this is an id not a name, no use.

$mech->field( ".af-city", "Monsey");
$mech->field( {xpath => '//*[@id="af-zip"]'}, "10952");
choroba
  • 231,213
  • 25
  • 204
  • 289
  • 1
    What is going to happen with that form? If you submit that, it will not be included in the request without a name. There has to be some Javascript that does tings to the values. The classes `input-field` and `postal-code-validate` and the `autocomplete` and the fact that there are ids but not names support that. Mechanize::Firefox cannot execute Javascript, though. I doubt even if you manage to put something in them it will be of much use. Inspect the communication on the page with a real browser and look at what it does, then try to simulate that instead. – simbabque Mar 28 '18 at 15:54

0 Answers0