Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

is there a way to convert firefox live http headers to mechanize commands

by tmaly (Monk)
on Oct 20, 2010 at 14:36 UTC ( [id://866342]=perlquestion: print w/replies, xml ) Need Help??

tmaly has asked for the wisdom of the Perl Monks concerning the following question:

Monks, is there a script or module available that could convert the firefox live http headers to mechanize output? My goal is to automate logging on to a site that contains javascript and has a number of complex forms to navigate through.

I am working with strawberry perl on windows, and I have tried the HTTP::Proxy + HTTP::Recorder technique but that does not work well on this system and seems to crash on me.

Best Regards Ty

  • Comment on is there a way to convert firefox live http headers to mechanize commands

Replies are listed 'Best First'.
Re: is there a way to convert firefox live http headers to mechanize commands
by Corion (Patriarch) on Oct 20, 2010 at 14:42 UTC

    I use (and admittedly wrote) WWW::Mechanize::Firefox. But there is no way to convert the record of your interactions in Live Headers to a WWW::Mechanize(::Firefox) script that I'm aware of. Your best approach is to carefully record your interaction manually and write a program that replicates them.

      My luck, just after I posted my question, I came across this script http://sourceforge.net/projects/lhhreplay/

      While it seems to be written for a unix platform seeing calls to rm, I can mod it for windows and I should be able to tell if it will work

      Best Regards
      Ty

        don't forget to change the options in the calls to unix commands to the proper options in windows ;)
        there are people in this world that get paid lots and only manage to change rm to del, and fail to see and won't even admit there's a difference...this is on a windows cygwin setup, sigh. anyway, if there's no software conflicts and you control the windows box, maybe install cygwin..so you can have some unix heaven on windows too.
        the hardest line to type correctly is: stty erase ^H
Re: is there a way to convert firefox live http headers to mechanize commands
by Your Mother (Archbishop) on Oct 21, 2010 at 04:38 UTC

    I feel like this should be possible but don't have an hour to sink into messing around with it tonight. The LiveHeaders output (after you configure it to only record pertinent URIs) can be parsed from a text dump. They can then be pretty easily loaded into HTTP::Request objects which you could use, I think, with Mech.

    I'm just sort of spitballing it though. I might be leaving something out but I suspect that unless there are transitory checksums or tokens coming from JS that this shouldn't be super hard. I'll come back to it if I have time tomorrow.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://866342]
Approved by moritz
Front-paged by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-19 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found