This reminds me of a very old Perl module called HTTP::Recorder [1]. It used to set a Http Proxy for WWW::Mechanize and then output a WWW::Mechanize script to automate the requests.
I used for testing long time back. Of course it didn't allow Javasript because it ran on Mechanize but it also meant it was extremely fast.