in reply to Post in a forum

I would begin by using HTTP::Recorder to record a successful manual form submission. The output of HTTP::Recorder, just as with WWW::Mechanize::Shell, can be "dropped" right into your WWW::Mechanize scripts. (leira's article "Web Testing with HTTP::Recorder" contains an excellent example of how you might want to do this.)

Note that if you are dealing with javascript, you might need to use Win32::IE::Mechanize. If you run into problems, try Super Searching for "mech javascript" - there are many relevant nodes here.

Another important tool for finding out what is really happening behind the scenes between server and browser is a protocol analyzer such as Wireshark, or, if you are using Firefox, something like Live HTTP Headers.

HTH,

planetscape

Replies are listed 'Best First'.
Re^2: Post in a forum
by Anonymous Monk on Aug 17, 2008 at 11:55 UTC
    Hi, I think there's a problem installing HTTP::Proxy in order to use HTTP::Recorder
    cpan[6]> install HTTP::Proxy Running install for module 'HTTP::Proxy' Running Build for B/BO/BOOK/HTTP-Proxy-0.22.tar.gz Has already been unwrapped into directory /root/.cpan/build/HTTP-Pro +xy-0.22-jA2UFx Has already been made Running Build test t/00basic...........ok t/01pod.............ok t/02pod-coverage....ok t/05new.............ok t/10init............ok t/11log.............ok t/15accessors.......ok 1/30maxconn is deprecated, please use max_conne +ctions at t/15accessors.t line 42 maxserve is deprecated, please use max_keep_alive_requests at t/15acce +ssors.t line 42 t/15accessors.......ok t/15deprecated......ok t/16stash...........ok t/17fstack..........ok t/18engine..........ok t/20dummy...........ok t/20keepalive.......ok t/22http............ok t/22transparent.....ok t/23connect.........NOK 2/4 # Failed test 'Read some data from the socket' # at t/23connect.t line 65. t/23connect.........NOK 3/4 # Failed test 'CONNECTed to the TCP server and got the banner' # at t/23connect.t line 66. # got: '' # expected: 'President_of_Earth Barbarella Professor_Ping Stomoxys + Dildano # ' t/23connect.........FAILED tests 2-3 Failed 2/4 tests, 50.00% okay t/23https...........skipped all skipped: Can't make this work with Crypt::SSLeay t/40push_filters....ok t/41filters.........ok t/42will_modify.....ok t/50hopbyhop........ok t/50standard........ok t/50via.............ok t/51simple..........ok t/51simple2.........ok t/61simple..........ok t/61simple2.........ok t/64htmltext........ok t/64lines...........ok t/64tags............ok t/66htmlparser......ok t/67complete........ok t/67save............ok t/71rot13...........ok t/90diveintomark....ok Failed Test Stat Wstat Total Fail List of Failed ---------------------------------------------------------------------- +--------- t/23connect.t 4 2 2-3 1 test skipped. Failed 1/35 test scripts. 2/473 subtests failed. Files=35, Tests=473, 51 wallclock secs ( 8.60 cusr + 1.56 csys = 10.1 +6 CPU) Failed 1/35 test programs. 2/473 subtests failed. BOOK/HTTP-Proxy-0.22.tar.gz ./Build test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports BOOK/HTTP-Proxy-0.22.tar.gz Running Build install make test had returned bad status, won't install without force Failed during this command: BOOK/HTTP-Proxy-0.22.tar.gz : make_test NO
    What could I do to solve this problem ?
        I am just curious, but what legitimate reasons are there for wanting to automate posting messages in a forum?
        Thanks all for your help. But I've finally find the solution with curl which is easier for me because no need to learn perl langage. It is true that it's important to analyze the response using a tool like LiveHTTP headers. In most of case, if we want to post in a forum, we need to first login to keep dynamic datas like cookies, and secondly match the URL that we use really. Thanks again and perhaps see you soon.