in reply to LWP Multiple Submit Buttons

Here's my checklist of things to check when automating web pages:

  1. Does the page work with your browser?
  2. What data is your browser sending?
  3. What data is your program sending?
  4. Where do they differ?
  5. How can you make them both send the same data?

In your case, I recommend starting over by using WWW::Mechanize, which has a click() method that faithfully simulates what many browsers send when you click on a form submit button.

Replies are listed 'Best First'.
Re^2: LWP Multiple Submit Buttons
by Anonymous Monk on Jul 16, 2004 at 11:50 UTC
    Hi. Thanks for that suggestion I'll have a go with Mechanize. Also is there a good way to see what my browser is sending?

      This really depends on what browser you are using. For Mozilla and Fire$ANIMAL, there is liveheaders, which displays the sent headers in a separate window. If you are using another browser, you might want a proxy which dumps all traffic going through it. Such a proxy could be written with HTTP::Proxy for example, but other solutions are also possible, by simply sniffing all traffic with ethereal or Net::PCap.

      Even if you are using WWW::Mechanize, it's not a panacea - there will come a time when you really need to see what the differences are to make WWW::Mechanize mimic a specific browser in the closest possible way.

        Thanks very much. Liveheaders is genius! It was a load of spaces in another field that was throwing it. Turns out those two lines were fine! Working fine now.

        Many thanks. Liveheaders is genius! Really easy to spot where I went wrong. It was a set of spaces in another field that was shifting al the following pairs out of sync. All sorted now. Thanks again